Skip to main content

Deckset Inline

Include content from other files in your Deckset slides.

Okay how?

First install the tool:

pip install deckset-inliner

Then prepare a file from which you want to include some content. This is a_file.py:

print("Hello I am a text file, but this line is not interesting.")
print("This second line, though, is vital for any presentation.")
print("This third line should be included too.")
print("But not this fourth one, don't care for this one.")

Then add an opening inline directive and a closing inline directive to your presentation Markdown file, where you want the content to appear:

<!-- <inline src="a_file.py" verbatim lang="python" start="2" end="3"> -->
<!-- </inline> -->

Then run the tool with your presentation file:

deckset-inliner --in-place --backup-ext bak slides.md

See how your file has been modified in-place, and you now have the lines 2 to 3 of a_file.py included between the directives:

<!-- <inline src="a_file.py" verbatim lang="python" start="2" end="3"> -->
```python
print("This second line, though, is vital for any presentation.")
print("This third line should be included too.")
```
<!-- </inline> -->

See how the directives stay? You can now run the command again after you change the source files.

I see, but why?

I want to test the code that I put in my slides, so I write it in proper code files that I then run and test (Yes, I sometimes write tests for the code in my slides). If I find an issue with the code, I don't want to be copy-pasting code into the slides again. This tools takes care of that for me.

Okay, I want this, tell me more

Welcome!

Directives are one line HTML comments with a home made tag inside. The basic directive has the tag name inline and these are the available attributes:

  • src: The only mandatory attribute, it specifies the path of the file to include.
  • verbatim: A flag. When present (it takes no value), the included code will be surrounded by lines with 3 backtics each ```
  • lang: Implies verbatim. Specifies the language that will appear at the top of the backticks block.
  • start: The first line of the source file (counted starting at 1) that will appear in the block.
  • end: The last line of the source file (counted starting at 1) that will appear in the block.

For convenience, I've added a second directive called python, which is equivalent of setting lang="python" on an inline directive.

The tool puts its output on stdout by default, like sed does, only if you pass the -i (--in-place) flag it will modify the original file. I recommend you also use the -b (--backup-ext) flag to force the creation of a backup of your file, if you aren't using version control for your slides.

There is also an option (-c or --clean) which deletes all the content between opening and closing directives, while leaving the directives themselves intact.

Any caveats?

  • The inline operation is not recursive, and the tool will not handle well if you include files that contain other directives.
  • The parsing is quite rudimentary and line based, so directives cannot span across multiple lines.

Metadata

Release files for deckset-inline 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for deckset-inline 0.1.0
File Size Uploaded Provenance Actions
deckset-inline-0.1.0.tar.gz 9.3 kB Without provenance Details for deckset-inline-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for deckset-inline 0.1.0
File Interpreter ABI Platform Actions
deckset_inline-0.1.0-py3-none-any.whl Python 3 none any Details for deckset_inline-0.1.0-py3-none-any.whl

Total release size: 17.4 kB

Release files / deckset-inline-0.1.0.tar.gz

Download URL deckset-inline-0.1.0.tar.gz
Size 9.3 kB
Tags Source
SHA-256 checksum
How to use checksums
c2e3fae535a79eb3a36fd4326b9f0f0512157561108bcdd09eb6bee39788b9f0
BLAKE2b-256 checksum
How to use checksums
c3751fd3369a364ec0fd7460fd83eae8ea2987f54d624302e9d5bfea5d161c80
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.3.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.0

Release files / deckset_inline-0.1.0-py3-none-any.whl

Download URL deckset_inline-0.1.0-py3-none-any.whl
Size 8.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a0135622d9709eec93b473677b5b73d15d00128f9eb7c9c1be8898ad787999b5
BLAKE2b-256 checksum
How to use checksums
854ea71aaa45448a9dbca7aebac351e0bff5ab12130002ca60461c2be2aa1dbf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.3.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.0

Security for deckset-inline 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page