Writing a book using sphinx #sphinxconjp 2012

Takayuki Shimizukawa
Takayuki ShimizukawaWeb Developer at BePROUD Inc.
Presentation detail is here




Writing a Book
Using Sphinx
    2012/9/16
SphinxCon JP 2012
Who am I?
http://清水川.jp/ @shimizukawa

●   BeProud Corp.
●   Expert Python Programming
    translator into Japanese
●   Sphinx-users.jp vice-chairman
●   PyConJP 2011,2012 vice-chairman
Python Professional Programming
●   Publisher: Shuwa System
●   Size: B5, 430 pages
●   2940 JPY
●   2012-3-27

call it #pypro
Fortunately, a lot of selling
Our editor has sold the #pypro on PyConJP.
However, many people had already
purchased.
Book's concept
● BPStyle (BeProud style):
  The book tell BP has been cultivated in
  the practice, the know-how of Python at
  work.

● for BP newbe:
  The book for work early to get accustomed
  to the new members of the company.
Table of Contents
4 parts, 15 chapters

1.   Let's develop with Python
2.   Cycle of team development
3.   Publish service
4.   Technique to accelerate the development
Part 1: Let's develop with Python
Chapter 1: Let's start Python
Chapter 2: Create a Web application


Appendix A: VirtualBox setup
Appendix B: OS(Ubuntu) setup
Part 2: Cycle of team development
Chapter 3: Create an environment of team
development
Chapter 4: Prepare the foundation for document
Chapter 5: Review and issue management
Chapter 6: Design of module division and unit
testing
Chapter 7: Automated packaging and environment
setup
Chapter 8: Source Code Management with
Mercurial
Chapter 9: Continuous Integration with Jenkins
Part 3: Publish service
Chapter 10: Automated environment to build and deploy
Chapter 11: Improve the performance of applications
Chapter 12: Google App Engine


Part 4: Technique to accelerate the
development
Chapter 13: Test is our friend
Chapter 14: Use Django to conveniently
Chapter 15: To use the handy Python module
Authors
1. tell-k: Chap 1,12,
   Appendix A, B
2. Okano: Chap 2,8,11,15
3. aita: Chap 3             8. (aodag): Chap 6
4. Shimizukawa: Chap 4,7    9. monjudoh: Chap 8
5. Imagawa Yakata: Chap
                           10. cactusman: Chap
   5,9
                               9
6. Azuma: Chap 5,10
                           11. drillbits: Chap 1,12
7. Tomita: Chap 5
                           12. natsu: Chap 13
                           13. Ikeda: Chap 14
                           14. Hata: Chap 14
PyPro book was written by Sphinx
● Sphinx = Documentation tool
  http://sphinx-users.jp/
Build a writing environment
automatically using Sphinx
First:
   $ hg clone [repos-of-pypro] pypro
   $ cd pypro
   $ python bootstrap.py
   $ bin/buildout

build HTML:
  $ vim 04.rst #chapter 04
  $ make html
Convert process of Sphinx

        reST(reStrucutrdText)

                     Docutils parser


          docutils node tree

                     Sphinx HTML writer



               HTML
Writing and Review
● Write by reST
● HTML Review by office-member
● PDF Review by outer-geeks

Provide different formats for different
purposes.

If you change the look, we now notice that
such wrong or strange expression that was
not noticed until then.
Submission format for Editor
process: Writer -> Editor -> Print
● [Editor -> Print]
   maybe 'InDesign' or else.

● [Writer -> Editor]
   the Shuwa-System format.
      5 wide square charactors ->    ■■■■■Chapter 1 Let's start Python

             2 wide charactors ->    ▽◆
        1 wide bullet charactor ->   ・Python setup
        1 wide bullet charactor ->   ・Mercurial setup
             2 wide charactors ->    △◆

      4 wide square charactors ->    ■■■■01-01 Python setup
Rewrite manually for submission?
● We wrote draft with Sphinx(reST)

● Submission format is different

● But, we can't write submission format. It's
  difficult for us :(

● Then, ...how?
I created Shuwa-Builder for Sphinx
● Shuwa-builder generate shuwa-system
  submission format from sphinx.




       Shuwa-System
Generate manuscript for Shuwa
Generate submission formatted manuscript
for Shuwa-System:

   $ make shuwa

That's all.

   $ ls _build/shuwa
   01.txt 02.txt 03.txt 04.txt ....
Spent over 2 days to create the
Shuwa-builder
● I took a lot of time to create the bulider.
● But monotonous repetitive work is painful
  to me.
● I will submit several times until publication.
  I will get a return on that investment.

shortly afterward, I applying proved
difference to original reST draft :(

3rd proof paper was PDF format. How do I
check diff?
Conclusion
What went wrong
● auto-generation of submission manuscript needs
  explicit spec.
● consider how to diff-incorporation

What worked
● Written in text that easy to writing and manage
  differential
● Review need differencial look
● To automate the preparation of environmental
● At any time to provide the latest HTML and PDF
  ○ that is provided by Jenkins at commit&push to the
      repository.
1 of 20

Recommended

Architecture of Moneys (Money Forms) by
Architecture of Moneys (Money Forms)Architecture of Moneys (Money Forms)
Architecture of Moneys (Money Forms)Doug McDavid
641 views34 slides
IKEv2-VPN PyHackCon2023 by
IKEv2-VPN PyHackCon2023IKEv2-VPN PyHackCon2023
IKEv2-VPN PyHackCon2023Takayuki Shimizukawa
20 views23 slides
Django ORM道場:クエリの基本を押さえ,より良い形を身に付けよう by
Django ORM道場:クエリの基本を押さえ,より良い形を身に付けようDjango ORM道場:クエリの基本を押さえ,より良い形を身に付けよう
Django ORM道場:クエリの基本を押さえ,より良い形を身に付けようTakayuki Shimizukawa
189 views52 slides
OpenTelemetryでWebシステムの処理を追跡しよう - DjangoCongress JP 2022 by
OpenTelemetryでWebシステムの処理を追跡しよう - DjangoCongress JP 2022OpenTelemetryでWebシステムの処理を追跡しよう - DjangoCongress JP 2022
OpenTelemetryでWebシステムの処理を追跡しよう - DjangoCongress JP 2022Takayuki Shimizukawa
1.5K views46 slides
Webアプリを並行開発する際のマイグレーション戦略 by
Webアプリを並行開発する際のマイグレーション戦略Webアプリを並行開発する際のマイグレーション戦略
Webアプリを並行開発する際のマイグレーション戦略Takayuki Shimizukawa
4.8K views49 slides
『自走プログラマー』 が我々に必要だった理由 by
『自走プログラマー』 が我々に必要だった理由『自走プログラマー』 が我々に必要だった理由
『自走プログラマー』 が我々に必要だった理由Takayuki Shimizukawa
739 views22 slides

More Related Content

More from Takayuki Shimizukawa

独学プログラマーのその後 by
独学プログラマーのその後独学プログラマーのその後
独学プログラマーのその後Takayuki Shimizukawa
839 views24 slides
【修正版】Django + SQLAlchemy: シンプルWay by
【修正版】Django + SQLAlchemy: シンプルWay【修正版】Django + SQLAlchemy: シンプルWay
【修正版】Django + SQLAlchemy: シンプルWayTakayuki Shimizukawa
11.2K views51 slides
Sphinx customization for OGP support at SphinxCon JP 2018 by
Sphinx customization for OGP support at SphinxCon JP 2018Sphinx customization for OGP support at SphinxCon JP 2018
Sphinx customization for OGP support at SphinxCon JP 2018Takayuki Shimizukawa
2.9K views34 slides
Pythonはどうやってlen関数で長さを手にいれているの? by
Pythonはどうやってlen関数で長さを手にいれているの?Pythonはどうやってlen関数で長さを手にいれているの?
Pythonはどうやってlen関数で長さを手にいれているの?Takayuki Shimizukawa
38.1K views56 slides
仕事で使うちょっとしたコードをOSSとして開発メンテしていく - Django Redshift Backend の開発 - PyCon JP 2016 by
仕事で使うちょっとしたコードをOSSとして開発メンテしていく- Django Redshift Backend の開発 - PyCon JP 2016仕事で使うちょっとしたコードをOSSとして開発メンテしていく- Django Redshift Backend の開発 - PyCon JP 2016
仕事で使うちょっとしたコードをOSSとして開発メンテしていく - Django Redshift Backend の開発 - PyCon JP 2016Takayuki Shimizukawa
4K views64 slides
Easy contributable internationalization process with Sphinx @ PyCon APAC 2016 by
Easy contributable internationalization process with Sphinx @ PyCon APAC 2016Easy contributable internationalization process with Sphinx @ PyCon APAC 2016
Easy contributable internationalization process with Sphinx @ PyCon APAC 2016Takayuki Shimizukawa
3.1K views66 slides

More from Takayuki Shimizukawa(20)

【修正版】Django + SQLAlchemy: シンプルWay by Takayuki Shimizukawa
【修正版】Django + SQLAlchemy: シンプルWay【修正版】Django + SQLAlchemy: シンプルWay
【修正版】Django + SQLAlchemy: シンプルWay
Takayuki Shimizukawa11.2K views
Sphinx customization for OGP support at SphinxCon JP 2018 by Takayuki Shimizukawa
Sphinx customization for OGP support at SphinxCon JP 2018Sphinx customization for OGP support at SphinxCon JP 2018
Sphinx customization for OGP support at SphinxCon JP 2018
Pythonはどうやってlen関数で長さを手にいれているの? by Takayuki Shimizukawa
Pythonはどうやってlen関数で長さを手にいれているの?Pythonはどうやってlen関数で長さを手にいれているの?
Pythonはどうやってlen関数で長さを手にいれているの?
Takayuki Shimizukawa38.1K views
仕事で使うちょっとしたコードをOSSとして開発メンテしていく - Django Redshift Backend の開発 - PyCon JP 2016 by Takayuki Shimizukawa
仕事で使うちょっとしたコードをOSSとして開発メンテしていく- Django Redshift Backend の開発 - PyCon JP 2016仕事で使うちょっとしたコードをOSSとして開発メンテしていく- Django Redshift Backend の開発 - PyCon JP 2016
仕事で使うちょっとしたコードをOSSとして開発メンテしていく - Django Redshift Backend の開発 - PyCon JP 2016
Easy contributable internationalization process with Sphinx @ PyCon APAC 2016 by Takayuki Shimizukawa
Easy contributable internationalization process with Sphinx @ PyCon APAC 2016Easy contributable internationalization process with Sphinx @ PyCon APAC 2016
Easy contributable internationalization process with Sphinx @ PyCon APAC 2016
素振りのススメ at Python入門者の集い by Takayuki Shimizukawa
素振りのススメ at Python入門者の集い素振りのススメ at Python入門者の集い
素振りのススメ at Python入門者の集い
JUS関西 Sphinxワークショップ@関西 Sphinx紹介 by Takayuki Shimizukawa
JUS関西 Sphinxワークショップ@関西 Sphinx紹介JUS関西 Sphinxワークショップ@関西 Sphinx紹介
JUS関西 Sphinxワークショップ@関西 Sphinx紹介
Sphinxで作る貢献しやすい ドキュメント翻訳の仕組み by Takayuki Shimizukawa
Sphinxで作る貢献しやすいドキュメント翻訳の仕組みSphinxで作る貢献しやすいドキュメント翻訳の仕組み
Sphinxで作る貢献しやすい ドキュメント翻訳の仕組み
Takayuki Shimizukawa28.1K views
Sphinx autodoc - automated api documentation - PyCon.KR 2015 by Takayuki Shimizukawa
Sphinx autodoc - automated api documentation - PyCon.KR 2015Sphinx autodoc - automated api documentation - PyCon.KR 2015
Sphinx autodoc - automated api documentation - PyCon.KR 2015
Easy contributable internationalization process with Sphinx @ pyconmy2015 by Takayuki Shimizukawa
Easy contributable internationalization process with Sphinx @ pyconmy2015Easy contributable internationalization process with Sphinx @ pyconmy2015
Easy contributable internationalization process with Sphinx @ pyconmy2015
Sphinx autodoc - automated api documentation - PyCon.MY 2015 by Takayuki Shimizukawa
Sphinx autodoc - automated api documentation - PyCon.MY 2015Sphinx autodoc - automated api documentation - PyCon.MY 2015
Sphinx autodoc - automated api documentation - PyCon.MY 2015
Sphinx autodoc - automated API documentation (EuroPython 2015 in Bilbao) by Takayuki Shimizukawa
Sphinx autodoc - automated API documentation (EuroPython 2015 in Bilbao)Sphinx autodoc - automated API documentation (EuroPython 2015 in Bilbao)
Sphinx autodoc - automated API documentation (EuroPython 2015 in Bilbao)
Easy contributable internationalization process with Sphinx @ pyconsg2015 by Takayuki Shimizukawa
Easy contributable internationalization process with Sphinx @ pyconsg2015Easy contributable internationalization process with Sphinx @ pyconsg2015
Easy contributable internationalization process with Sphinx @ pyconsg2015
Sphinx autodoc - automated API documentation (PyCon APAC 2015 in Taiwan) by Takayuki Shimizukawa
Sphinx autodoc - automated API documentation (PyCon APAC 2015 in Taiwan)Sphinx autodoc - automated API documentation (PyCon APAC 2015 in Taiwan)
Sphinx autodoc - automated API documentation (PyCon APAC 2015 in Taiwan)
Easy contributable internationalization process with Sphinx (PyCon APAC 2015 ... by Takayuki Shimizukawa
Easy contributable internationalization process with Sphinx (PyCon APAC 2015 ...Easy contributable internationalization process with Sphinx (PyCon APAC 2015 ...
Easy contributable internationalization process with Sphinx (PyCon APAC 2015 ...
PyPro2の読みどころ紹介:Python開発の過去と現在 - BPStudy93 by Takayuki Shimizukawa
PyPro2の読みどころ紹介:Python開発の過去と現在 - BPStudy93PyPro2の読みどころ紹介:Python開発の過去と現在 - BPStudy93
PyPro2の読みどころ紹介:Python開発の過去と現在 - BPStudy93
PyPro2の読みどころ紹介:Python開発の過去と現在 by Takayuki Shimizukawa
PyPro2の読みどころ紹介:Python開発の過去と現在PyPro2の読みどころ紹介:Python開発の過去と現在
PyPro2の読みどころ紹介:Python開発の過去と現在
Takayuki Shimizukawa11.9K views

Recently uploaded

DALI Basics Course 2023 by
DALI Basics Course  2023DALI Basics Course  2023
DALI Basics Course 2023Ivory Egg
16 views12 slides
virtual reality.pptx by
virtual reality.pptxvirtual reality.pptx
virtual reality.pptxG036GaikwadSnehal
11 views15 slides
Data-centric AI and the convergence of data and model engineering: opportunit... by
Data-centric AI and the convergence of data and model engineering:opportunit...Data-centric AI and the convergence of data and model engineering:opportunit...
Data-centric AI and the convergence of data and model engineering: opportunit...Paolo Missier
39 views40 slides
From chaos to control: Managing migrations and Microsoft 365 with ShareGate! by
From chaos to control: Managing migrations and Microsoft 365 with ShareGate!From chaos to control: Managing migrations and Microsoft 365 with ShareGate!
From chaos to control: Managing migrations and Microsoft 365 with ShareGate!sammart93
9 views39 slides
Roadmap to Become Experts.pptx by
Roadmap to Become Experts.pptxRoadmap to Become Experts.pptx
Roadmap to Become Experts.pptxdscwidyatamanew
14 views45 slides
Report 2030 Digital Decade by
Report 2030 Digital DecadeReport 2030 Digital Decade
Report 2030 Digital DecadeMassimo Talia
15 views41 slides

Recently uploaded(20)

DALI Basics Course 2023 by Ivory Egg
DALI Basics Course  2023DALI Basics Course  2023
DALI Basics Course 2023
Ivory Egg16 views
Data-centric AI and the convergence of data and model engineering: opportunit... by Paolo Missier
Data-centric AI and the convergence of data and model engineering:opportunit...Data-centric AI and the convergence of data and model engineering:opportunit...
Data-centric AI and the convergence of data and model engineering: opportunit...
Paolo Missier39 views
From chaos to control: Managing migrations and Microsoft 365 with ShareGate! by sammart93
From chaos to control: Managing migrations and Microsoft 365 with ShareGate!From chaos to control: Managing migrations and Microsoft 365 with ShareGate!
From chaos to control: Managing migrations and Microsoft 365 with ShareGate!
sammart939 views
iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas... by Bernd Ruecker
iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas...iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas...
iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas...
Bernd Ruecker33 views
HTTP headers that make your website go faster - devs.gent November 2023 by Thijs Feryn
HTTP headers that make your website go faster - devs.gent November 2023HTTP headers that make your website go faster - devs.gent November 2023
HTTP headers that make your website go faster - devs.gent November 2023
Thijs Feryn21 views
Igniting Next Level Productivity with AI-Infused Data Integration Workflows by Safe Software
Igniting Next Level Productivity with AI-Infused Data Integration Workflows Igniting Next Level Productivity with AI-Infused Data Integration Workflows
Igniting Next Level Productivity with AI-Infused Data Integration Workflows
Safe Software257 views
handbook for web 3 adoption.pdf by Liveplex
handbook for web 3 adoption.pdfhandbook for web 3 adoption.pdf
handbook for web 3 adoption.pdf
Liveplex22 views
Special_edition_innovator_2023.pdf by WillDavies22
Special_edition_innovator_2023.pdfSpecial_edition_innovator_2023.pdf
Special_edition_innovator_2023.pdf
WillDavies2217 views
Web Dev - 1 PPT.pdf by gdsczhcet
Web Dev - 1 PPT.pdfWeb Dev - 1 PPT.pdf
Web Dev - 1 PPT.pdf
gdsczhcet60 views
AMAZON PRODUCT RESEARCH.pdf by JerikkLaureta
AMAZON PRODUCT RESEARCH.pdfAMAZON PRODUCT RESEARCH.pdf
AMAZON PRODUCT RESEARCH.pdf
JerikkLaureta19 views
Voice Logger - Telephony Integration Solution at Aegis by Nirmal Sharma
Voice Logger - Telephony Integration Solution at AegisVoice Logger - Telephony Integration Solution at Aegis
Voice Logger - Telephony Integration Solution at Aegis
Nirmal Sharma31 views
Black and White Modern Science Presentation.pptx by maryamkhalid2916
Black and White Modern Science Presentation.pptxBlack and White Modern Science Presentation.pptx
Black and White Modern Science Presentation.pptx
maryamkhalid291616 views
6g - REPORT.pdf by Liveplex
6g - REPORT.pdf6g - REPORT.pdf
6g - REPORT.pdf
Liveplex10 views
Unit 1_Lecture 2_Physical Design of IoT.pdf by StephenTec
Unit 1_Lecture 2_Physical Design of IoT.pdfUnit 1_Lecture 2_Physical Design of IoT.pdf
Unit 1_Lecture 2_Physical Design of IoT.pdf
StephenTec12 views

Writing a book using sphinx #sphinxconjp 2012

  • 1. Presentation detail is here Writing a Book Using Sphinx 2012/9/16 SphinxCon JP 2012
  • 2. Who am I? http://清水川.jp/ @shimizukawa ● BeProud Corp. ● Expert Python Programming translator into Japanese ● Sphinx-users.jp vice-chairman ● PyConJP 2011,2012 vice-chairman
  • 3. Python Professional Programming ● Publisher: Shuwa System ● Size: B5, 430 pages ● 2940 JPY ● 2012-3-27 call it #pypro
  • 4. Fortunately, a lot of selling Our editor has sold the #pypro on PyConJP. However, many people had already purchased.
  • 5. Book's concept ● BPStyle (BeProud style): The book tell BP has been cultivated in the practice, the know-how of Python at work. ● for BP newbe: The book for work early to get accustomed to the new members of the company.
  • 6. Table of Contents 4 parts, 15 chapters 1. Let's develop with Python 2. Cycle of team development 3. Publish service 4. Technique to accelerate the development
  • 7. Part 1: Let's develop with Python Chapter 1: Let's start Python Chapter 2: Create a Web application Appendix A: VirtualBox setup Appendix B: OS(Ubuntu) setup
  • 8. Part 2: Cycle of team development Chapter 3: Create an environment of team development Chapter 4: Prepare the foundation for document Chapter 5: Review and issue management Chapter 6: Design of module division and unit testing Chapter 7: Automated packaging and environment setup Chapter 8: Source Code Management with Mercurial Chapter 9: Continuous Integration with Jenkins
  • 9. Part 3: Publish service Chapter 10: Automated environment to build and deploy Chapter 11: Improve the performance of applications Chapter 12: Google App Engine Part 4: Technique to accelerate the development Chapter 13: Test is our friend Chapter 14: Use Django to conveniently Chapter 15: To use the handy Python module
  • 10. Authors 1. tell-k: Chap 1,12, Appendix A, B 2. Okano: Chap 2,8,11,15 3. aita: Chap 3 8. (aodag): Chap 6 4. Shimizukawa: Chap 4,7 9. monjudoh: Chap 8 5. Imagawa Yakata: Chap 10. cactusman: Chap 5,9 9 6. Azuma: Chap 5,10 11. drillbits: Chap 1,12 7. Tomita: Chap 5 12. natsu: Chap 13 13. Ikeda: Chap 14 14. Hata: Chap 14
  • 11. PyPro book was written by Sphinx ● Sphinx = Documentation tool http://sphinx-users.jp/
  • 12. Build a writing environment automatically using Sphinx First: $ hg clone [repos-of-pypro] pypro $ cd pypro $ python bootstrap.py $ bin/buildout build HTML: $ vim 04.rst #chapter 04 $ make html
  • 13. Convert process of Sphinx reST(reStrucutrdText) Docutils parser docutils node tree Sphinx HTML writer HTML
  • 14. Writing and Review ● Write by reST ● HTML Review by office-member ● PDF Review by outer-geeks Provide different formats for different purposes. If you change the look, we now notice that such wrong or strange expression that was not noticed until then.
  • 15. Submission format for Editor process: Writer -> Editor -> Print ● [Editor -> Print] maybe 'InDesign' or else. ● [Writer -> Editor] the Shuwa-System format. 5 wide square charactors -> ■■■■■Chapter 1 Let's start Python 2 wide charactors -> ▽◆ 1 wide bullet charactor -> ・Python setup 1 wide bullet charactor -> ・Mercurial setup 2 wide charactors -> △◆ 4 wide square charactors -> ■■■■01-01 Python setup
  • 16. Rewrite manually for submission? ● We wrote draft with Sphinx(reST) ● Submission format is different ● But, we can't write submission format. It's difficult for us :( ● Then, ...how?
  • 17. I created Shuwa-Builder for Sphinx ● Shuwa-builder generate shuwa-system submission format from sphinx. Shuwa-System
  • 18. Generate manuscript for Shuwa Generate submission formatted manuscript for Shuwa-System: $ make shuwa That's all. $ ls _build/shuwa 01.txt 02.txt 03.txt 04.txt ....
  • 19. Spent over 2 days to create the Shuwa-builder ● I took a lot of time to create the bulider. ● But monotonous repetitive work is painful to me. ● I will submit several times until publication. I will get a return on that investment. shortly afterward, I applying proved difference to original reST draft :( 3rd proof paper was PDF format. How do I check diff?
  • 20. Conclusion What went wrong ● auto-generation of submission manuscript needs explicit spec. ● consider how to diff-incorporation What worked ● Written in text that easy to writing and manage differential ● Review need differencial look ● To automate the preparation of environmental ● At any time to provide the latest HTML and PDF ○ that is provided by Jenkins at commit&push to the repository.