├── .github
└── ISSUE_TEMPLATE
│ ├── bug_report.md
│ └── submit-slides-to-gallery.md
├── .gitignore
├── .readthedocs.yml
├── HISTORY.md
├── LICENSE
├── README.md
├── docs
├── Makefile
├── _static
│ ├── codio.gif
│ ├── css
│ │ └── gallery.css
│ ├── demo.gif
│ ├── favicon.ico
│ ├── gallery
│ │ ├── back-to-school.gif
│ │ ├── payment-systems-in-india.png
│ │ ├── the-hitchhikers-guide-to-clis-in-python.png
│ │ ├── trustless-bridges.gif
│ │ └── welcome-to-coding.gif
│ └── present.png
├── _templates
│ ├── hacks.html
│ ├── sidebarintro.html
│ └── sidebarlogo.html
├── _themes
│ ├── .gitignore
│ ├── LICENSE
│ └── flask_theme_support.py
├── codio.rst
├── conf.py
├── contributing.rst
├── gallery.py
├── gallery
│ ├── back-to-school
│ │ ├── codios
│ │ │ ├── async.yml
│ │ │ └── sync.yml
│ │ ├── index.rst
│ │ └── slides.md
│ ├── index.rst
│ ├── payment-systems-in-india
│ │ ├── images
│ │ │ └── paytm.jpg
│ │ ├── index.rst
│ │ └── slides.md
│ ├── the-hitchhikers-guide-to-clis-in-python
│ │ ├── codios
│ │ │ ├── echo.yml
│ │ │ ├── git-clone.yml
│ │ │ ├── git-commit.yml
│ │ │ ├── git-config.yml
│ │ │ ├── git-log.yml
│ │ │ ├── git-push.yml
│ │ │ ├── git-status.yml
│ │ │ ├── icanon.yml
│ │ │ ├── onlcr.yml
│ │ │ └── progress-bar.yml
│ │ ├── images
│ │ │ ├── camelot.png
│ │ │ ├── pyconline-au.jpg
│ │ │ └── recurse-center.png
│ │ ├── index.rst
│ │ └── slides.md
│ ├── trustless-bridges
│ │ ├── index.rst
│ │ └── slides.md
│ └── welcome-to-coding
│ │ ├── codios
│ │ └── start_class.yml
│ │ ├── index.rst
│ │ └── slides.md
├── index.rst
└── make.bat
├── examples
├── codio.md
├── codio.yml
├── images
│ └── recurse.png
└── sample.md
├── present.png
├── present
├── __init__.py
├── __main__.py
├── __version__.py
├── cli.py
├── effects.py
├── markdown.py
├── slide.py
└── slideshow.py
├── pyproject.toml
└── setup.py
/.github/ISSUE_TEMPLATE/bug_report.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Bug report
3 | about: You can follow this template to submit bug reports.
4 | title: ''
5 | labels: bug
6 | assignees: ''
7 |
8 | ---
9 |
10 |
11 |
12 | **Describe the bug**
13 | A clear and concise description of what the bug is.
14 |
15 | **Steps to reproduce the bug**
16 | Steps used to install `present`:
17 | 1. Add step here (you can add more steps too)
18 |
19 | Steps to reproduce the behavior:
20 | 1. Add step here (you can add more steps too)
21 |
22 | **Expected behavior**
23 | A clear and concise description of what you expected to happen.
24 |
25 | **Slides**
26 | If applicable, add slides to help explain your problem.
27 | ```
28 | Add markdown for the slide that caused the problem
29 | ```
30 |
31 | **Screenshots**
32 | If applicable, add screenshots to help explain your problem.
33 |
34 | **Environment**
35 | - OS: [e.g. MacOS]
36 | - Terminal emulator: [e.g. guake]
37 | - Python version: [e.g. 3.7]
38 | - `present` version: [e.g. 0.5.1]
39 |
40 | **Additional context**
41 | Add any other context about the problem here.
42 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/submit-slides-to-gallery.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Submit slides to gallery
3 | about: You can follow this template to submit your slides to the gallery.
4 | title: Add slides to gallery
5 | labels: made-with-present
6 | assignees: ''
7 |
8 | ---
9 |
10 | **Title**
11 |
12 |
13 | **Description**
14 |
15 |
16 | **Image**
17 |
18 |
19 | **Link**
20 |
21 |
22 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .vscode/
2 |
3 | # Byte-compiled / optimized / DLL files
4 | __pycache__/
5 | *.py[cod]
6 | *$py.class
7 |
8 | # C extensions
9 | *.so
10 |
11 | # Distribution / packaging
12 | .Python
13 | build/
14 | develop-eggs/
15 | dist/
16 | downloads/
17 | eggs/
18 | .eggs/
19 | lib/
20 | lib64/
21 | parts/
22 | sdist/
23 | var/
24 | wheels/
25 | pip-wheel-metadata/
26 | share/python-wheels/
27 | *.egg-info/
28 | .installed.cfg
29 | *.egg
30 | MANIFEST
31 |
32 | # PyInstaller
33 | # Usually these files are written by a python script from a template
34 | # before PyInstaller builds the exe, so as to inject date/other infos into it.
35 | *.manifest
36 | *.spec
37 |
38 | # Installer logs
39 | pip-log.txt
40 | pip-delete-this-directory.txt
41 |
42 | # Unit test / coverage reports
43 | htmlcov/
44 | .tox/
45 | .nox/
46 | .coverage
47 | .coverage.*
48 | .cache
49 | nosetests.xml
50 | coverage.xml
51 | *.cover
52 | *.py,cover
53 | .hypothesis/
54 | .pytest_cache/
55 |
56 | # Translations
57 | *.mo
58 | *.pot
59 |
60 | # Django stuff:
61 | *.log
62 | local_settings.py
63 | db.sqlite3
64 | db.sqlite3-journal
65 |
66 | # Flask stuff:
67 | instance/
68 | .webassets-cache
69 |
70 | # Scrapy stuff:
71 | .scrapy
72 |
73 | # Sphinx documentation
74 | docs/_build/
75 |
76 | # PyBuilder
77 | target/
78 |
79 | # Jupyter Notebook
80 | .ipynb_checkpoints
81 |
82 | # IPython
83 | profile_default/
84 | ipython_config.py
85 |
86 | # pyenv
87 | .python-version
88 |
89 | # pipenv
90 | # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
91 | # However, in case of collaboration, if having platform-specific dependencies or dependencies
92 | # having no cross-platform support, pipenv may install dependencies that don't work, or not
93 | # install all needed dependencies.
94 | #Pipfile.lock
95 |
96 | # PEP 582; used by e.g. github.com/David-OConnor/pyflow
97 | __pypackages__/
98 |
99 | # Celery stuff
100 | celerybeat-schedule
101 | celerybeat.pid
102 |
103 | # SageMath parsed files
104 | *.sage.py
105 |
106 | # Environments
107 | .env
108 | .venv
109 | env/
110 | venv/
111 | ENV/
112 | env.bak/
113 | venv.bak/
114 |
115 | # Spyder project settings
116 | .spyderproject
117 | .spyproject
118 |
119 | # Rope project settings
120 | .ropeproject
121 |
122 | # mkdocs documentation
123 | /site
124 |
125 | # mypy
126 | .mypy_cache/
127 | .dmypy.json
128 | dmypy.json
129 |
130 | # Pyre type checker
131 | .pyre/
132 |
--------------------------------------------------------------------------------
/.readthedocs.yml:
--------------------------------------------------------------------------------
1 | # .readthedocs.yml
2 | # Read the Docs configuration file
3 | # See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
4 |
5 | # Required
6 | version: 2
7 |
8 | # Build documentation in the docs/ directory with Sphinx
9 | sphinx:
10 | configuration: docs/conf.py
11 |
12 | # Build documentation with MkDocs
13 | #mkdocs:
14 | # configuration: mkdocs.yml
15 |
16 | # Optionally build your docs in additional formats such as PDF
17 | formats:
18 | - pdf
19 |
20 | # Optionally set the version of Python and requirements required to build your docs
21 | python:
22 | version: 3.8
23 | install:
24 | - method: pip
25 | path: .
26 | extra_requirements:
27 | - dev
28 |
--------------------------------------------------------------------------------
/HISTORY.md:
--------------------------------------------------------------------------------
1 | Release History
2 | ===============
3 |
4 | master
5 | ------
6 |
7 | 0.6.0 (2020-09-09)
8 | ------------------
9 |
10 | **Enhancements**
11 |
12 | * [#88](https://github.com/vinayak-mehta/present/issues/88) Support Page Up/Down for switching slides. [#90](https://github.com/vinayak-mehta/present/pull/90) by [Gaby](https://github.com/GitSquared).
13 |
14 | **Bugfixes**
15 |
16 | * [#83](https://github.com/vinayak-mehta/present/issues/83) Having two consecutive image inclusion lines causes NotImplementedError. [#85](https://github.com/vinayak-mehta/present/pull/85) by Vinayak Mehta.
17 | * [#82](https://github.com/vinayak-mehta/present/issues/82) Using markdown comments throws NotImplementedError. [#84](https://github.com/vinayak-mehta/present/pull/84) by Vinayak Mehta.
18 | * [#80](https://github.com/vinayak-mehta/present/issues/80) Image paths aren't relative to the current working directory. [#81](https://github.com/vinayak-mehta/present/pull/81) by [Tymoteusz Makowski](https://github.com/tmakowski).
19 |
20 | **Documentation**
21 |
22 | * Add a gallery! [#74](https://github.com/vinayak-mehta/present/pull/74) by Vinayak Mehta.
23 | * [#36](https://github.com/vinayak-mehta/present/issues/36) Add contributing guide. [#69](https://github.com/vinayak-mehta/present/pull/69) by Vinayak Mehta.
24 |
25 | 0.5.1 (2020-08-31)
26 | ------------------
27 |
28 | **Bugfixes**
29 |
30 | * [#48](https://github.com/vinayak-mehta/present/issues/48), [#54](https://github.com/vinayak-mehta/present/issues/54), [#52](https://github.com/vinayak-mehta/present/issues/52) Remove italics support temporarily. [#58](https://github.com/vinayak-mehta/present/pull/58) by Vinayak Mehta.
31 | * [#55](https://github.com/vinayak-mehta/present/issues/55) Yank versions older than `0.5.0` from PyPI because they didn't have `python_requires>=3.7`.
32 |
33 | 0.5.0 (2020-08-30)
34 | ------------------
35 |
36 | **Enhancements**
37 |
38 | * [#26](https://github.com/vinayak-mehta/present/issues/26) Add codio support. [#20](https://github.com/vinayak-mehta/present/pull/20) by Vinayak Mehta.
39 | * [#35](https://github.com/vinayak-mehta/present/issues/35) Support bold/italic text, inline code, links and block quotes. [#38](https://github.com/vinayak-mehta/present/pull/38) by Vinayak Mehta.
40 | * [#32](https://github.com/vinayak-mehta/present/issues/32) Make level 3 headings bold. [#33](https://github.com/vinayak-mehta/present/pull/33) by Vinayak Mehta.
41 | * Allow pressing spacebar to go to next slide. [#30](https://github.com/vinayak-mehta/present/pull/30) by [Thomas Royal](https://github.com/tmroyal).
42 | * [#27](https://github.com/vinayak-mehta/present/issues/27) Don't raise an error for unsupported markdown elements. [#34](https://github.com/vinayak-mehta/present/pull/34) by Vinayak Mehta.
43 | * Unvendor `mistune`.
44 |
45 | **Bugfixes**
46 |
47 | * [#28](https://github.com/vinayak-mehta/present/issues/28) Render single elements using mid point. [#31](https://github.com/vinayak-mehta/present/pull/31) by Vinayak Mehta.
48 |
49 | 0.4.0 (2020-08-27)
50 | ------------------
51 |
52 | **Enhancements**
53 |
54 | * Allow `Slideshow` to be used as a context manager. [#18](https://github.com/vinayak-mehta/present/pull/18) by [Clint Lawrence](https://github.com/clint-lawrence).
55 |
56 | Also, the earlier duct tape fix `os.system('reset')` (to not leave the terminal in an abnormal state after exit) is replaced with a `screen.close()` which is much better because the earlier fix wouldn't work on Windows.
57 |
58 | * Move an element to the center when there is only one on a slide. [6a0b045](https://github.com/vinayak-mehta/present/commit/6a0b045d0837dc05729d45427c6fae66a1d197ad) by Vinayak Mehta.
59 |
60 | 0.3.0 (2020-08-20)
61 | ------------------
62 |
63 | **Enhancements**
64 |
65 | * [#17](https://github.com/vinayak-mehta/present/issues/17) Raise informative error when image file does not exist. [564fa72](https://github.com/vinayak-mehta/present/commit/564fa727ec66eda93684dfaa25b7f6f5a4033972) by Vinayak Mehta.
66 |
67 | **Bugfixes**
68 |
69 | * [#16](https://github.com/vinayak-mehta/present/issues/16) Add variable size for h1 headings. [446385d](https://github.com/vinayak-mehta/present/commit/446385d75690bac940e3eeb665b9118f10c8aed4) by Vinayak Mehta.
70 |
71 | 0.2.0 (2020-08-20)
72 | ------------------
73 |
74 | * First working release!
75 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Apache License
2 | Version 2.0, January 2004
3 | http://www.apache.org/licenses/
4 |
5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6 |
7 | 1. Definitions.
8 |
9 | "License" shall mean the terms and conditions for use, reproduction,
10 | and distribution as defined by Sections 1 through 9 of this document.
11 |
12 | "Licensor" shall mean the copyright owner or entity authorized by
13 | the copyright owner that is granting the License.
14 |
15 | "Legal Entity" shall mean the union of the acting entity and all
16 | other entities that control, are controlled by, or are under common
17 | control with that entity. For the purposes of this definition,
18 | "control" means (i) the power, direct or indirect, to cause the
19 | direction or management of such entity, whether by contract or
20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
21 | outstanding shares, or (iii) beneficial ownership of such entity.
22 |
23 | "You" (or "Your") shall mean an individual or Legal Entity
24 | exercising permissions granted by this License.
25 |
26 | "Source" form shall mean the preferred form for making modifications,
27 | including but not limited to software source code, documentation
28 | source, and configuration files.
29 |
30 | "Object" form shall mean any form resulting from mechanical
31 | transformation or translation of a Source form, including but
32 | not limited to compiled object code, generated documentation,
33 | and conversions to other media types.
34 |
35 | "Work" shall mean the work of authorship, whether in Source or
36 | Object form, made available under the License, as indicated by a
37 | copyright notice that is included in or attached to the work
38 | (an example is provided in the Appendix below).
39 |
40 | "Derivative Works" shall mean any work, whether in Source or Object
41 | form, that is based on (or derived from) the Work and for which the
42 | editorial revisions, annotations, elaborations, or other modifications
43 | represent, as a whole, an original work of authorship. For the purposes
44 | of this License, Derivative Works shall not include works that remain
45 | separable from, or merely link (or bind by name) to the interfaces of,
46 | the Work and Derivative Works thereof.
47 |
48 | "Contribution" shall mean any work of authorship, including
49 | the original version of the Work and any modifications or additions
50 | to that Work or Derivative Works thereof, that is intentionally
51 | submitted to Licensor for inclusion in the Work by the copyright owner
52 | or by an individual or Legal Entity authorized to submit on behalf of
53 | the copyright owner. For the purposes of this definition, "submitted"
54 | means any form of electronic, verbal, or written communication sent
55 | to the Licensor or its representatives, including but not limited to
56 | communication on electronic mailing lists, source code control systems,
57 | and issue tracking systems that are managed by, or on behalf of, the
58 | Licensor for the purpose of discussing and improving the Work, but
59 | excluding communication that is conspicuously marked or otherwise
60 | designated in writing by the copyright owner as "Not a Contribution."
61 |
62 | "Contributor" shall mean Licensor and any individual or Legal Entity
63 | on behalf of whom a Contribution has been received by Licensor and
64 | subsequently incorporated within the Work.
65 |
66 | 2. Grant of Copyright License. Subject to the terms and conditions of
67 | this License, each Contributor hereby grants to You a perpetual,
68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69 | copyright license to reproduce, prepare Derivative Works of,
70 | publicly display, publicly perform, sublicense, and distribute the
71 | Work and such Derivative Works in Source or Object form.
72 |
73 | 3. Grant of Patent License. Subject to the terms and conditions of
74 | this License, each Contributor hereby grants to You a perpetual,
75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76 | (except as stated in this section) patent license to make, have made,
77 | use, offer to sell, sell, import, and otherwise transfer the Work,
78 | where such license applies only to those patent claims licensable
79 | by such Contributor that are necessarily infringed by their
80 | Contribution(s) alone or by combination of their Contribution(s)
81 | with the Work to which such Contribution(s) was submitted. If You
82 | institute patent litigation against any entity (including a
83 | cross-claim or counterclaim in a lawsuit) alleging that the Work
84 | or a Contribution incorporated within the Work constitutes direct
85 | or contributory patent infringement, then any patent licenses
86 | granted to You under this License for that Work shall terminate
87 | as of the date such litigation is filed.
88 |
89 | 4. Redistribution. You may reproduce and distribute copies of the
90 | Work or Derivative Works thereof in any medium, with or without
91 | modifications, and in Source or Object form, provided that You
92 | meet the following conditions:
93 |
94 | (a) You must give any other recipients of the Work or
95 | Derivative Works a copy of this License; and
96 |
97 | (b) You must cause any modified files to carry prominent notices
98 | stating that You changed the files; and
99 |
100 | (c) You must retain, in the Source form of any Derivative Works
101 | that You distribute, all copyright, patent, trademark, and
102 | attribution notices from the Source form of the Work,
103 | excluding those notices that do not pertain to any part of
104 | the Derivative Works; and
105 |
106 | (d) If the Work includes a "NOTICE" text file as part of its
107 | distribution, then any Derivative Works that You distribute must
108 | include a readable copy of the attribution notices contained
109 | within such NOTICE file, excluding those notices that do not
110 | pertain to any part of the Derivative Works, in at least one
111 | of the following places: within a NOTICE text file distributed
112 | as part of the Derivative Works; within the Source form or
113 | documentation, if provided along with the Derivative Works; or,
114 | within a display generated by the Derivative Works, if and
115 | wherever such third-party notices normally appear. The contents
116 | of the NOTICE file are for informational purposes only and
117 | do not modify the License. You may add Your own attribution
118 | notices within Derivative Works that You distribute, alongside
119 | or as an addendum to the NOTICE text from the Work, provided
120 | that such additional attribution notices cannot be construed
121 | as modifying the License.
122 |
123 | You may add Your own copyright statement to Your modifications and
124 | may provide additional or different license terms and conditions
125 | for use, reproduction, or distribution of Your modifications, or
126 | for any such Derivative Works as a whole, provided Your use,
127 | reproduction, and distribution of the Work otherwise complies with
128 | the conditions stated in this License.
129 |
130 | 5. Submission of Contributions. Unless You explicitly state otherwise,
131 | any Contribution intentionally submitted for inclusion in the Work
132 | by You to the Licensor shall be under the terms and conditions of
133 | this License, without any additional terms or conditions.
134 | Notwithstanding the above, nothing herein shall supersede or modify
135 | the terms of any separate license agreement you may have executed
136 | with Licensor regarding such Contributions.
137 |
138 | 6. Trademarks. This License does not grant permission to use the trade
139 | names, trademarks, service marks, or product names of the Licensor,
140 | except as required for reasonable and customary use in describing the
141 | origin of the Work and reproducing the content of the NOTICE file.
142 |
143 | 7. Disclaimer of Warranty. Unless required by applicable law or
144 | agreed to in writing, Licensor provides the Work (and each
145 | Contributor provides its Contributions) on an "AS IS" BASIS,
146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147 | implied, including, without limitation, any warranties or conditions
148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149 | PARTICULAR PURPOSE. You are solely responsible for determining the
150 | appropriateness of using or redistributing the Work and assume any
151 | risks associated with Your exercise of permissions under this License.
152 |
153 | 8. Limitation of Liability. In no event and under no legal theory,
154 | whether in tort (including negligence), contract, or otherwise,
155 | unless required by applicable law (such as deliberate and grossly
156 | negligent acts) or agreed to in writing, shall any Contributor be
157 | liable to You for damages, including any direct, indirect, special,
158 | incidental, or consequential damages of any character arising as a
159 | result of this License or out of the use or inability to use the
160 | Work (including but not limited to damages for loss of goodwill,
161 | work stoppage, computer failure or malfunction, or any and all
162 | other commercial damages or losses), even if such Contributor
163 | has been advised of the possibility of such damages.
164 |
165 | 9. Accepting Warranty or Additional Liability. While redistributing
166 | the Work or Derivative Works thereof, You may choose to offer,
167 | and charge a fee for, acceptance of support, warranty, indemnity,
168 | or other liability obligations and/or rights consistent with this
169 | License. However, in accepting such obligations, You may act only
170 | on Your own behalf and on Your sole responsibility, not on behalf
171 | of any other Contributor, and only if You agree to indemnify,
172 | defend, and hold each Contributor harmless for any liability
173 | incurred by, or claims asserted against, such Contributor by reason
174 | of your accepting any such warranty or additional liability.
175 |
176 | END OF TERMS AND CONDITIONS
177 |
178 | APPENDIX: How to apply the Apache License to your work.
179 |
180 | To apply the Apache License to your work, attach the following
181 | boilerplate notice, with the fields enclosed by brackets "[]"
182 | replaced with your own identifying information. (Don't include
183 | the brackets!) The text should be enclosed in the appropriate
184 | comment syntax for the file format. We also recommend that a
185 | file or class name and description of purpose be included on the
186 | same "printed page" as the copyright notice for easier
187 | identification within third-party archives.
188 |
189 | Copyright [yyyy] [name of copyright owner]
190 |
191 | Licensed under the Apache License, Version 2.0 (the "License");
192 | you may not use this file except in compliance with the License.
193 | You may obtain a copy of the License at
194 |
195 | http://www.apache.org/licenses/LICENSE-2.0
196 |
197 | Unless required by applicable law or agreed to in writing, software
198 | distributed under the License is distributed on an "AS IS" BASIS,
199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200 | See the License for the specific language governing permissions and
201 | limitations under the License.
202 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | # present
6 |
7 | [](https://present.readthedocs.io/en/latest/) [](https://pypi.org/project/present/) [](https://pypi.org/project/present/) [](https://github.com/ambv/black) [](https://repl.it/@amasad/terminal-present)
8 |
9 | A terminal-based presentation tool with colors and effects.
10 |
11 |
12 |
13 |
14 |
15 | You can also play a [codio](https://present.readthedocs.io/en/latest/codio.html) (pre-recorded code block) on a slide.
16 |
17 |
18 |
19 |
20 |
21 | `present` is built on [asciimatics](https://github.com/peterbrittain/asciimatics), and it works with `Python>=3.7`.
22 |
23 | Check out the [gallery](https://present.readthedocs.io/en/latest/gallery/index.html) to see what everyone is making with `present`! You can add your slides by simply [opening an issue](https://github.com/vinayak-mehta/present/issues/new?assignees=&labels=made-with-present&template=submit-slides-to-gallery.md&title=Add+slides+to+gallery).
24 |
25 | ## Installation
26 |
27 | You can simply use pip to install `present`:
28 |
29 | ```bash
30 | $ pip install present
31 | ```
32 |
33 | ## Usage
34 |
35 | ```bash
36 | $ present sample.md
37 | ```
38 |
39 | Some controls:
40 |
41 | - Quit: `q`
42 | - Previous slide: `b`, Left arrow, Page Up
43 | - Next slide: `n`, Space bar, Right arrow, Page Down
44 |
45 | At the end, you can press `r` to restart the presentation.
46 |
47 | ## Syntax
48 |
49 | Slides follow [Markdown](https://guides.github.com/features/mastering-markdown/) syntax. You can check out the [sample slides](https://github.com/vinayak-mehta/present/blob/master/examples/sample.md) for reference.
50 |
51 | **Note:** Some things aren't supported yet:
52 | - Effects and colors on the same slide.
53 | - Effects and code on the same slide.
54 |
55 | ### Separator
56 |
57 | Each slide can be separated with a `---`.
58 |
59 | ```
60 | Slide 1
61 |
62 | ---
63 |
64 | Slide 2
65 | ```
66 |
67 | ### Headers
68 |
69 | Level 1 headings become figlets, level 2 headings get underlined with `-`, and level 3 headings become bold.
70 |
71 | ```
72 | # Heading 1
73 |
74 | ## Heading 2
75 |
76 | ### Heading 3
77 | ```
78 |
79 | ### Text
80 |
81 | ```
82 | This is normal text
83 |
84 | This is **bold text**
85 |
86 | This is `inline code`
87 |
88 | This is a [link](www.google.com)
89 |
90 | As Kanye West said:
91 |
92 | > We're living the future so
93 | > the present is our past.
94 | ```
95 |
96 | ### Lists
97 |
98 | Ordered lists become unordered lists automatically.
99 |
100 | ```
101 | - Item 1
102 | - Item 1a
103 | - Item 1b
104 | - Item 1c
105 | - Item 2
106 | - Item 2a
107 | ```
108 |
109 | ### Images
110 |
111 | Image paths are relative to the directory where your slides are kept, and where you invoke `present`.
112 |
113 | ```
114 | 
115 | ```
116 |
117 | Note: You can use high resolution images and tweak the terminal font size to get the best results.
118 |
119 | ### Code blocks
120 |
121 |
--------------------------------------------------------------------------------
/docs/_themes/.gitignore:
--------------------------------------------------------------------------------
1 | *.pyc
2 | *.pyo
--------------------------------------------------------------------------------
/docs/_themes/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2010 by Armin Ronacher.
2 |
3 | Some rights reserved.
4 |
5 | Redistribution and use in source and binary forms of the theme, with or
6 | without modification, are permitted provided that the following conditions
7 | are met:
8 |
9 | * Redistributions of source code must retain the above copyright
10 | notice, this list of conditions and the following disclaimer.
11 |
12 | * Redistributions in binary form must reproduce the above
13 | copyright notice, this list of conditions and the following
14 | disclaimer in the documentation and/or other materials provided
15 | with the distribution.
16 |
17 | * The names of the contributors may not be used to endorse or
18 | promote products derived from this software without specific
19 | prior written permission.
20 |
21 | We kindly ask you to only use these themes in an unmodified manner just
22 | for Flask and Flask-related products, not for unrelated projects. If you
23 | like the visual style and want to use it for your own projects, please
24 | consider making some larger changes to the themes (such as changing
25 | font faces, sizes, colors or margins).
26 |
27 | THIS THEME IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
28 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
29 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
30 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
31 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
32 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
33 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
34 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
35 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
36 | ARISING IN ANY WAY OUT OF THE USE OF THIS THEME, EVEN IF ADVISED OF THE
37 | POSSIBILITY OF SUCH DAMAGE.
--------------------------------------------------------------------------------
/docs/_themes/flask_theme_support.py:
--------------------------------------------------------------------------------
1 | # flasky pygments style based on tango style
2 | from pygments.style import Style
3 | from pygments.token import (
4 | Keyword,
5 | Name,
6 | Comment,
7 | String,
8 | Error,
9 | Number,
10 | Operator,
11 | Generic,
12 | Whitespace,
13 | Punctuation,
14 | Other,
15 | Literal,
16 | )
17 |
18 |
19 | class FlaskyStyle(Style):
20 | background_color = "#f8f8f8"
21 | default_style = ""
22 |
23 | styles = {
24 | # No corresponding class for the following:
25 | # Text: "", # class: ''
26 | Whitespace: "underline #f8f8f8", # class: 'w'
27 | Error: "#a40000 border:#ef2929", # class: 'err'
28 | Other: "#000000", # class 'x'
29 | Comment: "italic #8f5902", # class: 'c'
30 | Comment.Preproc: "noitalic", # class: 'cp'
31 | Keyword: "bold #004461", # class: 'k'
32 | Keyword.Constant: "bold #004461", # class: 'kc'
33 | Keyword.Declaration: "bold #004461", # class: 'kd'
34 | Keyword.Namespace: "bold #004461", # class: 'kn'
35 | Keyword.Pseudo: "bold #004461", # class: 'kp'
36 | Keyword.Reserved: "bold #004461", # class: 'kr'
37 | Keyword.Type: "bold #004461", # class: 'kt'
38 | Operator: "#582800", # class: 'o'
39 | Operator.Word: "bold #004461", # class: 'ow' - like keywords
40 | Punctuation: "bold #000000", # class: 'p'
41 | # because special names such as Name.Class, Name.Function, etc.
42 | # are not recognized as such later in the parsing, we choose them
43 | # to look the same as ordinary variables.
44 | Name: "#000000", # class: 'n'
45 | Name.Attribute: "#c4a000", # class: 'na' - to be revised
46 | Name.Builtin: "#004461", # class: 'nb'
47 | Name.Builtin.Pseudo: "#3465a4", # class: 'bp'
48 | Name.Class: "#000000", # class: 'nc' - to be revised
49 | Name.Constant: "#000000", # class: 'no' - to be revised
50 | Name.Decorator: "#888", # class: 'nd' - to be revised
51 | Name.Entity: "#ce5c00", # class: 'ni'
52 | Name.Exception: "bold #cc0000", # class: 'ne'
53 | Name.Function: "#000000", # class: 'nf'
54 | Name.Property: "#000000", # class: 'py'
55 | Name.Label: "#f57900", # class: 'nl'
56 | Name.Namespace: "#000000", # class: 'nn' - to be revised
57 | Name.Other: "#000000", # class: 'nx'
58 | Name.Tag: "bold #004461", # class: 'nt' - like a keyword
59 | Name.Variable: "#000000", # class: 'nv' - to be revised
60 | Name.Variable.Class: "#000000", # class: 'vc' - to be revised
61 | Name.Variable.Global: "#000000", # class: 'vg' - to be revised
62 | Name.Variable.Instance: "#000000", # class: 'vi' - to be revised
63 | Number: "#990000", # class: 'm'
64 | Literal: "#000000", # class: 'l'
65 | Literal.Date: "#000000", # class: 'ld'
66 | String: "#4e9a06", # class: 's'
67 | String.Backtick: "#4e9a06", # class: 'sb'
68 | String.Char: "#4e9a06", # class: 'sc'
69 | String.Doc: "italic #8f5902", # class: 'sd' - like a comment
70 | String.Double: "#4e9a06", # class: 's2'
71 | String.Escape: "#4e9a06", # class: 'se'
72 | String.Heredoc: "#4e9a06", # class: 'sh'
73 | String.Interpol: "#4e9a06", # class: 'si'
74 | String.Other: "#4e9a06", # class: 'sx'
75 | String.Regex: "#4e9a06", # class: 'sr'
76 | String.Single: "#4e9a06", # class: 's1'
77 | String.Symbol: "#4e9a06", # class: 'ss'
78 | Generic: "#000000", # class: 'g'
79 | Generic.Deleted: "#a40000", # class: 'gd'
80 | Generic.Emph: "italic #000000", # class: 'ge'
81 | Generic.Error: "#ef2929", # class: 'gr'
82 | Generic.Heading: "bold #000080", # class: 'gh'
83 | Generic.Inserted: "#00A000", # class: 'gi'
84 | Generic.Output: "#888", # class: 'go'
85 | Generic.Prompt: "#745334", # class: 'gp'
86 | Generic.Strong: "bold #000000", # class: 'gs'
87 | Generic.Subheading: "bold #800080", # class: 'gu'
88 | Generic.Traceback: "bold #a40000", # class: 'gt'
89 | }
90 |
--------------------------------------------------------------------------------
/docs/codio.rst:
--------------------------------------------------------------------------------
1 | .. _codio:
2 |
3 | codio
4 | =====
5 |
6 | A codio is a pre-recorded playable code block which can be useful for live demos. During the presentation, and on the slide with a codio, you can press ``r`` to reset the codio so that it starts playing again from the first line.
7 |
8 | .. image:: _static/codio.gif
9 |
10 | You can make a codio by writing all the input and output as plaintext in a `YAML `_ file (shown below), and use it inside your Markdown slides just like an image: ````. The image alt should be ``![codio]``, but filename can be anything.
11 |
12 | .. code-block:: yaml
13 |
14 | speed: 10
15 | lines:
16 | - prompt: $
17 | in: touch a.txt
18 | - prompt: $
19 | in: smol-git status
20 | - out: 'On branch master'
21 | - out: 'Changes to be committed:'
22 | - out: ' (use "git reset HEAD ..." to unstage)'
23 | - out: ' '
24 | - out: ' new file: a.txt'
25 | color: green
26 | bold: True
27 | - out: ' '
28 | - prompt: $
29 | in: smol-git add a.txt
30 | - prompt: $
31 | in: 'smol-git commit -m "Add a.txt"'
32 | - out: '[master b0faa5a] Save progress'
33 | - prompt: $
34 | in: smol-git push origin master
35 | out: "Pushing to 'origin'..."
36 | - progress: true
37 | progressChar: █
38 | - prompt: $
39 |
40 | Let's deconstruct this YAML.
41 |
42 | You can set the speed for your codio by specifying its value in a top-level key called ``speed``. It can be between 1 (very slow) to 10 (very fast).
43 |
44 | .. code-block:: yaml
45 |
46 | speed: 10
47 |
48 | You can specify each line in your code block as a prompt, input, and output item in the ``lines`` list. Input gets printed one character at a time, and output all at once.
49 |
50 | .. code-block:: yaml
51 |
52 | lines:
53 | - prompt: '>>>'
54 | in: 'os.getcwd()'
55 | out: '/home/vinayak/dev'
56 |
57 | You can also choose to skip output for some lines.
58 |
59 | .. code-block:: yaml
60 |
61 | lines:
62 | - prompt: '>>>'
63 | in: 'import os'
64 |
65 | To show a multi-line output (like in the first example), you can just specify one output per line.
66 |
67 | .. code-block:: yaml
68 |
69 | lines:
70 | - out: 'On branch master'
71 | - out: 'Changes to be committed:'
72 | - out: ' (use "git reset HEAD ..." to unstage)'
73 | - out: ' '
74 | - out: ' new file: a.txt'
75 |
76 | Notice the ``out: ' '`` to print an empty line.
77 |
78 | You can add colors and styles to your output like this:
79 |
80 | .. code-block:: yaml
81 |
82 | lines:
83 | - out: ' new file: a.txt'
84 | color: green
85 | bold: true
86 |
87 | Currently, these colors are supported: ``black``, ``red``, ``green``, ``yellow``, ``blue``, ``magenta``, ``cyan``, ``white``. And these styles are supported: ``bold`` and ``underline``. (``italics`` coming soon!)
88 |
89 | You can add progress bars too. To add one, just set ``progress`` to ``true`` and add a progress character for your progress bar using ``progressChar``. The default ``progressChar`` is ``█``.
90 |
91 | .. code-block:: yaml
92 |
93 | lines:
94 | - progress: true
95 | progressChar: #
96 |
97 | In the end, you can also print just a prompt again!
98 |
99 | .. code-block:: yaml
100 |
101 | lines:
102 | - prompt: $
103 |
--------------------------------------------------------------------------------
/docs/conf.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | #
3 | # present documentation build configuration file, created by
4 | # sphinx-quickstart on Tue Jul 19 13:44:18 2016.
5 | #
6 | # This file is execfile()d with the current directory set to its
7 | # containing dir.
8 | #
9 | # Note that not all possible configuration values are present in this
10 | # autogenerated file.
11 | #
12 | # All configuration values have a default; values that are commented out
13 | # serve to show the default.
14 |
15 | import os
16 | import sys
17 |
18 | # If extensions (or modules to document with autodoc) are in another directory,
19 | # add these directories to sys.path here. If the directory is relative to the
20 | # documentation root, use os.path.abspath to make it absolute, like shown here.
21 | #
22 | # sys.path.insert(0, os.path.abspath('..'))
23 |
24 | # Insert present's path into the system.
25 | sys.path.insert(0, os.path.abspath("."))
26 | sys.path.insert(0, os.path.abspath(".."))
27 | sys.path.insert(0, os.path.abspath("_themes"))
28 |
29 | import present
30 |
31 |
32 | # -- General configuration ------------------------------------------------
33 |
34 | # If your documentation needs a minimal Sphinx version, state it here.
35 | #
36 | # needs_sphinx = '1.0'
37 |
38 | # Add any Sphinx extension module names here, as strings. They can be
39 | # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
40 | # ones.
41 | extensions = ["gallery"]
42 |
43 | # Add any paths that contain templates here, relative to this directory.
44 | templates_path = ["_templates"]
45 |
46 | # The suffix(es) of source filenames.
47 | # You can specify multiple suffix as a list of string:
48 | #
49 | # source_suffix = ['.rst', '.md']
50 | source_suffix = ".rst"
51 |
52 | # The encoding of source files.
53 | #
54 | # source_encoding = 'utf-8-sig'
55 |
56 | # The master toctree document.
57 | master_doc = "index"
58 |
59 | # General information about the project.
60 | project = u"conference-radar"
61 | copyright = u"2020, Vinayak Mehta"
62 | author = u"Vinayak Mehta"
63 |
64 | # The version info for the project you're documenting, acts as replacement for
65 | # |version| and |release|, also used in various other places throughout the
66 | # built documents.
67 |
68 | # The short X.Y version.
69 | version = present.__version__
70 | # The full version, including alpha/beta/rc tags.
71 | release = present.__version__
72 |
73 | # The language for content autogenerated by Sphinx. Refer to documentation
74 | # for a list of supported languages.
75 | #
76 | # This is also used if you do content translation via gettext catalogs.
77 | # Usually you set "language" from the command line for these cases.
78 | language = None
79 |
80 | # There are two options for replacing |today|: either, you set today to some
81 | # non-false value, then it is used:
82 | #
83 | # today = ''
84 | #
85 | # Else, today_fmt is used as the format for a strftime call.
86 | #
87 | # today_fmt = '%B %d, %Y'
88 |
89 | # List of patterns, relative to source directory, that match files and
90 | # directories to ignore when looking for source files.
91 | # This patterns also effect to html_static_path and html_extra_path
92 | exclude_patterns = ["_build"]
93 |
94 | # The reST default role (used for this markup: `text`) to use for all
95 | # documents.
96 | #
97 | # default_role = None
98 |
99 | # If true, '()' will be appended to :func: etc. cross-reference text.
100 | add_function_parentheses = True
101 |
102 | # If true, the current module name will be prepended to all description
103 | # unit titles (such as .. function::).
104 | add_module_names = True
105 |
106 | # If true, sectionauthor and moduleauthor directives will be shown in the
107 | # output. They are ignored by default.
108 | #
109 | # show_authors = False
110 |
111 | # The name of the Pygments (syntax highlighting) style to use.
112 | pygments_style = "flask_theme_support.FlaskyStyle"
113 |
114 | # A list of ignored prefixes for module index sorting.
115 | # modindex_common_prefix = []
116 |
117 | # If true, keep warnings as "system message" paragraphs in the built documents.
118 | # keep_warnings = False
119 |
120 | # If true, `todo` and `todoList` produce output, else they produce nothing.
121 | todo_include_todos = True
122 |
123 |
124 | # -- Options for HTML output ----------------------------------------------
125 |
126 | # The theme to use for HTML and HTML Help pages. See the documentation for
127 | # a list of builtin themes.
128 | html_theme = "alabaster"
129 |
130 | # Theme options are theme-specific and customize the look and feel of a theme
131 | # further. For a list of options available for each theme, see the
132 | # documentation.
133 | html_theme_options = {
134 | "show_powered_by": False,
135 | "github_user": "vinayak-mehta",
136 | "github_repo": "present",
137 | "github_banner": True,
138 | "show_related": False,
139 | "note_bg": "#FFF59C",
140 | }
141 |
142 | # Add any paths that contain custom themes here, relative to this directory.
143 | # html_theme_path = []
144 |
145 | # The name for this set of Sphinx documents.
146 | # " v documentation" by default.
147 | #
148 | # html_title = None
149 |
150 | # A shorter title for the navigation bar. Default is the same as html_title.
151 | #
152 | # html_short_title = None
153 |
154 | # The name of an image file (relative to this directory) to place at the top
155 | # of the sidebar.
156 | #
157 | # html_logo = None
158 |
159 | # The name of an image file (relative to this directory) to use as a favicon of
160 | # the docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
161 | # pixels large.
162 | html_favicon = "_static/favicon.ico"
163 |
164 | # Add any paths that contain custom static files (such as style sheets) here,
165 | # relative to this directory. They are copied after the builtin static files,
166 | # so a file named "default.css" will overwrite the builtin "default.css".
167 | html_static_path = ["_static"]
168 |
169 | # These paths are either relative to html_static_path
170 | # or fully qualified paths (eg. https://...)
171 | html_css_files = [
172 | "css/gallery.css",
173 | ]
174 |
175 | # Add any extra paths that contain custom files (such as robots.txt or
176 | # .htaccess) here, relative to this directory. These files are copied
177 | # directly to the root of the documentation.
178 | #
179 | # html_extra_path = []
180 |
181 | # If not None, a 'Last updated on:' timestamp is inserted at every page
182 | # bottom, using the given strftime format.
183 | # The empty string is equivalent to '%b %d, %Y'.
184 | #
185 | # html_last_updated_fmt = None
186 |
187 | # If true, SmartyPants will be used to convert quotes and dashes to
188 | # typographically correct entities.
189 | html_use_smartypants = True
190 |
191 | # Custom sidebar templates, maps document names to template names.
192 | html_sidebars = {
193 | "index": [
194 | "sidebarintro.html",
195 | "relations.html",
196 | "sourcelink.html",
197 | "searchbox.html",
198 | "hacks.html",
199 | ],
200 | "**": [
201 | "sidebarlogo.html",
202 | "localtoc.html",
203 | "relations.html",
204 | "sourcelink.html",
205 | "searchbox.html",
206 | "hacks.html",
207 | ],
208 | }
209 |
210 | # Additional templates that should be rendered to pages, maps page names to
211 | # template names.
212 | #
213 | # html_additional_pages = {}
214 |
215 | # If false, no module index is generated.
216 | #
217 | # html_domain_indices = True
218 |
219 | # If false, no index is generated.
220 | #
221 | # html_use_index = True
222 |
223 | # If true, the index is split into individual pages for each letter.
224 | #
225 | # html_split_index = False
226 |
227 | # If true, links to the reST sources are added to the pages.
228 | html_show_sourcelink = False
229 |
230 | # If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
231 | html_show_sphinx = False
232 |
233 | # If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
234 | html_show_copyright = True
235 |
236 | # If true, an OpenSearch description file will be output, and all pages will
237 | # contain a tag referring to it. The value of this option must be the
238 | # base URL from which the finished HTML is served.
239 | #
240 | # html_use_opensearch = ''
241 |
242 | # This is the file name suffix for HTML files (e.g. ".xhtml").
243 | # html_file_suffix = None
244 |
245 | # Language to be used for generating the HTML full-text search index.
246 | # Sphinx supports the following languages:
247 | # 'da', 'de', 'en', 'es', 'fi', 'fr', 'hu', 'it', 'ja'
248 | # 'nl', 'no', 'pt', 'ro', 'ru', 'sv', 'tr', 'zh'
249 | #
250 | # html_search_language = 'en'
251 |
252 | # A dictionary with options for the search language support, empty by default.
253 | # 'ja' uses this config value.
254 | # 'zh' user can custom change `jieba` dictionary path.
255 | #
256 | # html_search_options = {'type': 'default'}
257 |
258 | # The name of a javascript file (relative to the configuration directory) that
259 | # implements a search results scorer. If empty, the default will be used.
260 | #
261 | # html_search_scorer = 'scorer.js'
262 |
263 | # Output file base name for HTML help builder.
264 | htmlhelp_basename = "presentdoc"
265 |
266 | # -- Options for LaTeX output ---------------------------------------------
267 |
268 | latex_elements = {
269 | # The paper size ('letterpaper' or 'a4paper').
270 | #
271 | # 'papersize': 'letterpaper',
272 | # The font size ('10pt', '11pt' or '12pt').
273 | #
274 | # 'pointsize': '10pt',
275 | # Additional stuff for the LaTeX preamble.
276 | #
277 | # 'preamble': '',
278 | # Latex figure (float) alignment
279 | #
280 | # 'figure_align': 'htbp',
281 | }
282 |
283 | # Grouping the document tree into LaTeX files. List of tuples
284 | # (source start file, target name, title,
285 | # author, documentclass [howto, manual, or own class]).
286 | latex_documents = [
287 | (
288 | master_doc,
289 | "present.tex",
290 | u"present documentation",
291 | u"Vinayak Mehta",
292 | "manual",
293 | )
294 | ]
295 |
296 | # The name of an image file (relative to this directory) to place at the top of
297 | # the title page.
298 | #
299 | # latex_logo = None
300 |
301 | # For "manual" documents, if this is true, then toplevel headings are parts,
302 | # not chapters.
303 | #
304 | # latex_use_parts = False
305 |
306 | # If true, show page references after internal links.
307 | #
308 | # latex_show_pagerefs = False
309 |
310 | # If true, show URL addresses after external links.
311 | #
312 | # latex_show_urls = False
313 |
314 | # Documents to append as an appendix to all manuals.
315 | #
316 | # latex_appendices = []
317 |
318 | # It false, will not define \strong, \code, itleref, \crossref ... but only
319 | # \sphinxstrong, ..., \sphinxtitleref, ... To help avoid clash with user added
320 | # packages.
321 | #
322 | # latex_keep_old_macro_names = True
323 |
324 | # If false, no module index is generated.
325 | #
326 | # latex_domain_indices = True
327 |
328 |
329 | # -- Options for manual page output ---------------------------------------
330 |
331 | # One entry per manual page. List of tuples
332 | # (source start file, name, description, authors, manual section).
333 | man_pages = [(master_doc, "present", u"present documentation", [author], 1)]
334 |
335 | # If true, show URL addresses after external links.
336 | #
337 | # man_show_urls = False
338 |
339 |
340 | # -- Options for Texinfo output -------------------------------------------
341 |
342 | # Grouping the document tree into Texinfo files. List of tuples
343 | # (source start file, target name, title, author,
344 | # dir menu entry, description, category)
345 | texinfo_documents = [
346 | (
347 | master_doc,
348 | "present",
349 | u"present documentation",
350 | author,
351 | "present",
352 | "One line description of project.",
353 | "Miscellaneous",
354 | )
355 | ]
356 |
357 | # Documents to append as an appendix to all manuals.
358 | #
359 | # texinfo_appendices = []
360 |
361 | # If false, no module index is generated.
362 | #
363 | # texinfo_domain_indices = True
364 |
365 | # How to display URL addresses: 'footnote', 'no', or 'inline'.
366 | #
367 | # texinfo_show_urls = 'footnote'
368 |
369 | # If true, do not generate a @detailmenu in the "Top" node's menu.
370 | #
371 | # texinfo_no_detailmenu = False
372 |
--------------------------------------------------------------------------------
/docs/contributing.rst:
--------------------------------------------------------------------------------
1 | .. _contributing:
2 |
3 | Contributor's Guide
4 | ===================
5 |
6 | Thanks for taking the time to contribute!
7 |
8 | This doc will help you get started with contributing issues, documentation, code, and tests. If you have any questions, feel free to reach out to `Vinayak Mehta`_, the author and maintainer.
9 |
10 | .. _Vinayak Mehta: https://github.com/vinayak-mehta
11 |
12 | Filing Issues
13 | -------------
14 |
15 | ``present`` uses `GitHub issues`_ to keep track of all issues and pull requests. Before opening an issue with a question or a bug report, please use the issue search feature to look for existing issues (both open and closed) that may be similar.
16 |
17 | .. _GitHub issues: https://github.com/vinayak-mehta/present/issues
18 |
19 | When opening an issue:
20 |
21 | 1. List the steps you used to install ``present``.
22 |
23 | 2. Make sure you include your operating system name, terminal emulator name, Python version number, and ``present`` version number. You can use the following code snippet to find most of this information::
24 |
25 | import platform; print('Platform', platform.platform())
26 | import sys; print('Python', sys.version)
27 | import present; print('Present', present.__version__)
28 |
29 | 3. Make sure you provide a suitable amount of information to work with. For example, the Markdown for the slide causing the issue in a `code block`_ (you can replace sensitive text with `lorem ipsum`_), what you expected to happen, and what actually happened.
30 |
31 | .. _lorem ipsum: https://www.lipsum.com/
32 |
33 | 4. When filing bug reports about exceptions or tracebacks, please include the complete traceback in a `code block`_, along with everything from 2.
34 |
35 | 5. When suggesting enhancements, please use a clear and descriptive title, along with a very detailed description of the suggested enhancement.
36 |
37 | .. _code block: https://help.github.com/articles/creating-and-highlighting-code-blocks/
38 |
39 | Contributing Docs and Code
40 | --------------------------
41 |
42 | Setting up the development environment
43 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
44 |
45 | To install the dependencies needed for development, you can use pip::
46 |
47 | $ pip install "present[dev]"
48 |
49 | Alternatively, you can clone the project repository, and use pip again to install everything::
50 |
51 | $ cd present
52 | $ pip install ".[dev]"
53 |
54 | Writing Documentation
55 | ^^^^^^^^^^^^^^^^^^^^^
56 |
57 | Writing documentation, function docstrings, examples and tutorials is a great way to start contributing to free and open-source software! The documentation for this project lies in the ``docs/`` directory of the repository, and it is written in `reStructuredText`_ with `Sphinx`_ used to generate these lovely HTML files that you're currently reading (unless you're reading this on GitHub). You can edit the documentation using any text editor and then submit a pull request.
58 |
59 | .. _reStructuredText: https://en.wikipedia.org/wiki/ReStructuredText
60 | .. _Sphinx: http://www.sphinx-doc.org/en/master/
61 |
62 | Contributing Code
63 | ^^^^^^^^^^^^^^^^^
64 |
65 | Another great way to start contributing to ``present`` is to pick an issue tagged with the `help wanted`_ or the `good first issue`_ tags. If you're unable to find a good first issue, feel free to contact the maintainer.
66 |
67 | .. _help wanted: https://github.com/vinayak-mehta/present/labels/help%20wanted
68 | .. _good first issue: https://github.com/vinayak-mehta/present/labels/good%20first%20issue
69 |
70 | Pull Requests
71 | -------------
72 |
73 | Submitting your pull request
74 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
75 |
76 | The preferred workflow for contributing to ``present`` is to fork the `project repository`_ on GitHub, clone, develop on a branch and then finally submit a pull request. Here are the steps:
77 |
78 | .. _project repository: https://github.com/vinayak-mehta/present
79 |
80 | 1. Fork the project repository. Click on the ‘Fork’ button near the top of the page. This creates a copy of the code under your account on the GitHub.
81 |
82 | 2. Clone your fork of ``present`` from your GitHub account::
83 |
84 | $ git clone https://www.github.com/[username]/present
85 |
86 | 3. Create a branch to hold your changes::
87 |
88 | $ git checkout -b my-feature
89 |
90 | Always branch out from ``master`` to work on your contribution. It's good practice to never work on the ``master`` branch!
91 |
92 | .. note:: ``git stash`` is a great way to save the work that you haven't committed yet, to move between branches.
93 |
94 | 4. Work on your contribution. Add changed files using ``git add`` and then ``git commit`` them::
95 |
96 | $ git add modified_files
97 | $ git commit
98 |
99 | 5. Finally, push them to your GitHub fork::
100 |
101 | $ git push -u origin my-feature
102 |
103 | Now it's time to go to the your fork of ``present`` and create a pull request! You can `follow these instructions`_ to do that.
104 |
105 | .. _follow these instructions: https://help.github.com/articles/creating-a-pull-request-from-a-fork/
106 |
107 | Working on your pull request
108 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
109 |
110 | It's recommended that your pull request complies with the following guidelines:
111 |
112 | - Make sure your code follows `pep8`_. You can also run `black`_ on your code since ``present`` follows ``black`` code style.
113 |
114 | .. _pep8: http://pep8.org
115 | .. _black: https://black.readthedocs.io/en/stable/
116 |
117 | - In case your pull request contains function docstrings, make sure you follow the `numpydoc`_ format.
118 |
119 | .. _numpydoc: https://numpydoc.readthedocs.io/en/latest/format.html
120 |
121 | - Make sure your commit messages follow `the seven rules of a great git commit message`_:
122 | - Separate subject from body with a blank line
123 | - Limit the subject line to 50 characters
124 | - Capitalize the subject line
125 | - Do not end the subject line with a period
126 | - Use the imperative mood in the subject line
127 | - Wrap the body at 72 characters
128 | - Use the body to explain what and why vs. how
129 |
130 | .. _the seven rules of a great git commit message: https://chris.beams.io/posts/git-commit/
131 |
132 | - If the contribution is complete and ready for a detailed review, prefix your title of your pull request with ``[MRG]`` (Ready for Merge). An incomplete pull request's title should be prefixed with ``[WIP]`` (to indicate work in progress), and changed to ``[MRG]`` when it's complete. A good `task list`_ in the PR description will ensure that other people get a fair idea of what it proposes to do, which will also increase collaboration.
133 |
134 | .. _task list: https://blog.github.com/2013-01-09-task-lists-in-gfm-issues-pulls-comments/
135 |
--------------------------------------------------------------------------------
/docs/gallery.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 |
3 | from docutils.nodes import Body, Element, SkipNode
4 | from docutils.parsers.rst import Directive, directives
5 |
6 |
7 | class Node(Body, Element):
8 | pass
9 |
10 |
11 | class GalleryImage(Directive):
12 | has_content = False
13 | required_arguments = 0
14 | optional_arguments = 0
15 | final_argument_whitespace = True
16 | option_spec = {
17 | "src": directives.unchanged,
18 | "stub": directives.unchanged,
19 | "description": directives.unchanged,
20 | }
21 |
22 | def run(self):
23 | node = Node()
24 | node["src"] = self.options["src"]
25 | node["stub"] = self.options["stub"]
26 | node["description"] = self.options["description"]
27 | return [node]
28 |
29 |
30 | def gallery_image_html(self, node):
31 | src = node["src"]
32 | stub = node["stub"]
33 | description = node["description"]
34 |
35 | template = f"""
36 |