diff --git a/README.md b/README.md index ca18771..1ffdfeb 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,8 @@ keynote-export \ --keynote= \ --outdir= \ --title= \ - --bluesky-handle= + --bluesky-handle= \ + --mastodon-handle= ``` The output path gets both a PDF file and a self-contained website that you can easily host with (for example) [GitHub pages](https://pages.github.com/). diff --git a/keynote_export/export.py b/keynote_export/export.py index 46834fc..176a8b6 100755 --- a/keynote_export/export.py +++ b/keynote_export/export.py @@ -26,7 +26,7 @@ class Options(object): def __init__( - self, outdir, pagesize, font_size, title, bsky_handle, skip_builds + self, outdir, pagesize, font_size, title, bsky_handle, mastodon_handle, skip_builds ): self.outdir = os.path.abspath(outdir) self.pagesize = pagesize @@ -36,6 +36,7 @@ def __init__( self.font = "SanFrancisco" self.title = title self.bsky_handle = bsky_handle + self.mastodon_handle = mastodon_handle self.skip_builds = skip_builds @property @@ -129,7 +130,6 @@ def export_keynote(filename, opts): return notes - def generate_html(opts, notes): def imgpath(s): return s.replace(opts.outdir + "/", "") @@ -144,6 +144,7 @@ def imgpath(s): ], title=opts.title, bsky_handle=opts.bsky_handle, + mastodon_handle=opts.mastodon_handle, ) outfile = os.path.join(opts.outdir, "index.html") @@ -154,7 +155,6 @@ def imgpath(s): os.path.join(opts.outdir, "presentation.css"), ) - @click.command() @click.option( "-k", @@ -192,6 +192,13 @@ def imgpath(s): required=False, type=click.STRING, ) +@click.option( + "-m", + "--mastodon-handle", + help="Mastodon handle for author", + required=False, + type=click.STRING, +) @click.option( "--skip-builds", is_flag=True, help="Skip build stages", default=False ) @@ -202,6 +209,7 @@ def main( font_size: int, title: str, bluesky_handle: Optional[str], + mastodon_handle: Optional[str], skip_builds: bool, ): pagesize = tuple([int(s) for s in pagesize.split("x")]) @@ -211,6 +219,7 @@ def main( font_size, title, bluesky_handle, + mastodon_handle, skip_builds, ) diff --git a/keynote_export/resources/presentation.css b/keynote_export/resources/presentation.css index 729fa04..4b03bbc 100644 --- a/keynote_export/resources/presentation.css +++ b/keynote_export/resources/presentation.css @@ -146,9 +146,16 @@ footer p { display: inline-flex; align-items: center; } +.mstdn { + display: inline-flex; + align-items: center; +} .bsky .handle { margin-left: 10px; } +.mstdn .handle { + margin-left: 10px; +} .share a, .share a:visited { color: #333; font-weight: 500; diff --git a/keynote_export/resources/share.jinja b/keynote_export/resources/share.jinja index 780ef44..acadfe9 100644 --- a/keynote_export/resources/share.jinja +++ b/keynote_export/resources/share.jinja @@ -3,4 +3,17 @@ @{{ bsky_handle }} + + + + + + + + + + + + @{{ mastodon_handle }} + diff --git a/pypi-readme.md b/pypi-readme.md index 2527b31..6feb30c 100644 --- a/pypi-readme.md +++ b/pypi-readme.md @@ -17,5 +17,6 @@ keynote-export \ --keynote= \ --outdir= \ --title= \ - --bluesky-handle= + --bluesky-handle= \ + --mastdoon-handle= ```