From 6dcf55aca84032a77a20f62ba0b2e14f9992f853 Mon Sep 17 00:00:00 2001 From: mDuo13 <mduo13@gmail.com> Date: Wed, 26 Jan 2022 17:14:50 -0800 Subject: [PATCH] v0.15.1: fix Windows PDF bug --- dactyl/dactyl_build.py | 5 +++-- dactyl/version.py | 2 +- examples/content/conditionals.md | 2 +- examples/content/extending/templates.md | 8 ++++---- examples/content/filters/external_links.md | 2 +- examples/content/gfm-compat.md | 6 +++--- examples/content/usage/config.md | 2 +- examples/content/usage/usage.md | 2 +- releasenotes.md | 6 ++++++ 9 files changed, 21 insertions(+), 14 deletions(-) diff --git a/dactyl/dactyl_build.py b/dactyl/dactyl_build.py index 15e813f..58b18be 100755 --- a/dactyl/dactyl_build.py +++ b/dactyl/dactyl_build.py @@ -18,6 +18,7 @@ # Necessary for prince import subprocess +import sys from time import sleep # Used to fetch markdown sources from the net @@ -464,7 +465,7 @@ def assemble_pdf(self): if self.http_port: # Start up an HTTP server for Prince. This helps it resolve absolute # URLs in hyperlinks correctly (which --fileroot doesn't quite do) - server = subprocess.Popen(["python3", "-m", "http.server", str(self.http_port)]) + server = subprocess.Popen([sys.executable, "-m", "http.server", str(self.http_port)]) # Wait for server to start sleep(1) @@ -493,7 +494,7 @@ def watch(self): """ if self.mode == "html" and self.http_port: - server = subprocess.Popen(["python3", "-m", "http.server", + server = subprocess.Popen([sys.executable, "-m", "http.server", str(self.http_port), "-d", self.out_path]) event_handler = UpdaterHandler(builder=self) diff --git a/dactyl/version.py b/dactyl/version.py index a842d05..6fccdee 100644 --- a/dactyl/version.py +++ b/dactyl/version.py @@ -1 +1 @@ -__version__ = '0.15.0' +__version__ = '0.15.1' diff --git a/examples/content/conditionals.md b/examples/content/conditionals.md index 8a40a76..330cc7e 100644 --- a/examples/content/conditionals.md +++ b/examples/content/conditionals.md @@ -2,7 +2,7 @@ You can use the preprocessor to hide or show certain content based on various conditions. For example, you can have a page used in multiple targets, but omit certain portions from the output in some targets. Or, you can have text and markup that only shows up in HTML mode but not PDF mode or similar rules. -You can use any of [the fields available to the preprocessor](https://github.com/ripple/dactyl/#pre-processing) for your conditionals, including [commandline variables](cli-vars.html) and any fields defined in the [frontmatter](with-frontmatter.html). +You can use any of [the fields available to the preprocessor](https://github.com/ripple/dactyl/#pre-processing) for your conditionals, including [commandline variables](cli-vars.html) and any fields defined in the [frontmatter](frontmatter.html). Example of printing different text by : diff --git a/examples/content/extending/templates.md b/examples/content/extending/templates.md index 7a16acd..c39c4b4 100644 --- a/examples/content/extending/templates.md +++ b/examples/content/extending/templates.md @@ -19,7 +19,7 @@ Many of the built-in templates work better if you set certain fields on your tar | `google_analytics_tag` | String tag to use with Google Analytics, e.g. "UA-00000000-0". If not defined, doesn't load Google Analytics. | | `repository` | URL to this site's source repository on GitHub. Required for the "Edit on GitHub" button. | | `url` | The fully-qualified URL for the base of the site. Required by the sitemap and Google Search templates. | -| `stylesheet` | URL or path to the default stylesheet. The default includes Bootstrap 4.5 as well as custom CSS for code tabs, callouts, and the page layout. See the [styles dir](./dactyl/styles/) for the source SCSS. The default is served by dactyl.link. | +| `stylesheet` | URL or path to the default stylesheet. The default includes Bootstrap 4.5 as well as custom CSS for code tabs, callouts, and the page layout. See the [styles dir](https://github.com/ripple/dactyl/tree/master/dactyl/styles) for the source SCSS. The default is served by dactyl.link. | | `dactyljs` | URL or path to the Dactyl JavaScript file to use. This defines "jump to top" and code tab behavior. The default is served by dactyl.link. | | `bootstrapjs` | URL or path to the Bootstrap JavaScript file to use. The default is served by BootstrapCDN. | | `fontawesomecss` | URL or path to FontAwesome (v4) CSS file to use. The default is served by BootstrapCDN. | @@ -39,7 +39,7 @@ The following built-in templates represent **full pages**, so you can use them w | `simple.html` | A minimal template with no dependencies. | | `template-sitemap.txt` | A template for a text [sitemap](https://support.google.com/webmasters/answer/183668?hl=en) for use by search engines. | -When extending the default templates, you many of them have blocks you can replace. For the full list, see [the templates](./dactyl/templates/) directly. +When extending the default templates, you many of them have blocks you can replace. For the full list, see [the templates](https://github.com/ripple/dactyl/tree/master/dactyl/templates) directly. ### Module Templates @@ -97,8 +97,8 @@ Dactyl provides the following information to templates, which you can access wit | Field | Value | |:------------------|:---------------------------------------------------------| -| `target` | The [target](#targets) definition of the current target. | -| `pages` | The [array of page definitions](#pages) in the current target. Use this to generate navigation across pages. (The default templates don't do this, but you should.) | +| `target` | The [target](config.html#targets) definition of the current target. | +| `pages` | The [array of page definitions](config.html#pages) in the current target. Use this to generate navigation across pages. (The default templates don't do this, but you should.) | | `currentpage` | The definition of the page currently being rendered. | | `categories` | A de-duplicated array of categories that are used by at least one page in this target, sorted in the order they first appear. | | `config` | The global Dactyl config object. | diff --git a/examples/content/filters/external_links.md b/examples/content/filters/external_links.md index 61d2f5b..f78b1bd 100644 --- a/examples/content/filters/external_links.md +++ b/examples/content/filters/external_links.md @@ -11,4 +11,4 @@ This filter adds an "external link" icon to [links to outside websites](https:// A [link to another page](filters.html) won't have the icon. -If you try to combine this filter with the [button links filter >](https://dactyl.link/filter-examples-buttonize.html), make sure **buttonize runs first**. Otherwise, external links will not get styled as buttons when intended. +If you try to combine this filter with the [button links filter >](https://dactyl.link/buttonize.html), make sure **buttonize runs first**. Otherwise, external links will not get styled as buttons when intended. diff --git a/examples/content/gfm-compat.md b/examples/content/gfm-compat.md index 403a43d..bc7e3df 100644 --- a/examples/content/gfm-compat.md +++ b/examples/content/gfm-compat.md @@ -11,12 +11,12 @@ GitHub-Flavored Markdown has some stuff that Dactyl doesn't do and vice-versa, a Dactyl doesn't do any of the following: -* https://github.com/gitlabhq/gitlabhq/blob/master/doc/markdown/markdown.md#url-auto-linking -* [Emoji codes](https://github.com/gitlabhq/gitlabhq/blob/master/doc/markdown/markdown.md#emoji) +* [Automatically make URLs into hyperlinks](https://github.github.com/gfm/#autolinks-extension-) +* [Emoji codes](https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#using-emoji) * Task lists - [x] completed - [ ] incomplete -* [GitLab references](https://github.com/gitlabhq/gitlabhq/blob/master/doc/markdown/markdown.md#special-gitlab-references) +* [Automatic references to GitHub (or GitLab) issues, commits, or external resources](https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/autolinked-references-and-urls) **Suggestion:** Avoid using these. diff --git a/examples/content/usage/config.md b/examples/content/usage/config.md index b760d3c..896b9a0 100644 --- a/examples/content/usage/config.md +++ b/examples/content/usage/config.md @@ -84,7 +84,7 @@ Each individual page definition can have the following fields: | `category` | String | _(Optional)_ The name of a category to group this page into. This is used by Dactyl's built-in templates to organize the table of contents. | | `template` | String | _(Optional)_ The filename of a custom [Jinja][] HTML template to use when building this page for HTML, relative to the **template_path** in your config. | | `pdf_template` | String | _(Optional)_ The filename of a custom [Jinja][] HTML template to use when building this page for PDF, relative to the **template_path** in your config. | -| `openapi_md_template_path` | String | _(Optional)_ Path to a folder containing [templates to be used for OpenAPI spec parsing](#openapi-spec-templates). If omitted, use the [built-in templates](dactyl/templates/). | +| `openapi_md_template_path` | String | _(Optional)_ Path to a folder containing [templates to be used for OpenAPI spec parsing](openapi.html). If omitted, use the [built-in templates](templates.html). | | `parent` | String | _(Optional)_ The HTML filename of the page to treat as a parent of this one for purposes of hierarchy. If omitted, treat the page as a "top-level" page. | | ... | (Various) | Additional arbitrary key-value pairs as desired. These values can be used by templates or pre-processing. | diff --git a/examples/content/usage/usage.md b/examples/content/usage/usage.md index ccf5cfb..b2e562c 100644 --- a/examples/content/usage/usage.md +++ b/examples/content/usage/usage.md @@ -42,7 +42,7 @@ By default, Dactyl looks for a config file named `dactyl-config.yml` in the curr $ dactyl_build -c path/to/alt-config.yml ``` -For more information on configuration, see the `default-config.yml` and the [examples](examples/) folder. +For more information on configuration, see [Configuration](config.html) and the [examples](https://github.com/ripple/dactyl/tree/master/examples) folder. ## Specifying a Target diff --git a/releasenotes.md b/releasenotes.md index 26f890b..fb16898 100644 --- a/releasenotes.md +++ b/releasenotes.md @@ -1,3 +1,9 @@ +# v0.15.1 Release Notes + +This release fixes a bug that made "watch mode" and PDF builds not work on Windows because it assumed that `python3 -m http.server` would launch the simple Python HTTP server on those systems. The updated version should automatically detect the system's Python executable on all platforms. + +This release also fixes some broken links in the updated documentation. + # v0.15.0 Release Notes This release improves OpenAPI spec parsing, adds a new formula for picking default filenames, overhauls Dactyl's own documentation, and fixes the following minor bugs: