Skip to content

Commit

Permalink
v0.15.1: fix Windows PDF bug
Browse files Browse the repository at this point in the history
  • Loading branch information
mDuo13 committed Jan 27, 2022
1 parent dc54c1f commit 6dcf55a
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 14 deletions.
5 changes: 3 additions & 2 deletions dactyl/dactyl_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

# Necessary for prince
import subprocess
import sys
from time import sleep

# Used to fetch markdown sources from the net
Expand Down Expand Up @@ -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)

Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion dactyl/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '0.15.0'
__version__ = '0.15.1'
2 changes: 1 addition & 1 deletion examples/content/conditionals.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 :

Expand Down
8 changes: 4 additions & 4 deletions examples/content/extending/templates.md
Original file line number Diff line number Diff line change
Expand Up @@ -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. |
Expand All @@ -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
Expand Down Expand Up @@ -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. |
Expand Down
2 changes: 1 addition & 1 deletion examples/content/filters/external_links.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
6 changes: 3 additions & 3 deletions examples/content/gfm-compat.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
2 changes: 1 addition & 1 deletion examples/content/usage/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -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. |

Expand Down
2 changes: 1 addition & 1 deletion examples/content/usage/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 6 additions & 0 deletions releasenotes.md
Original file line number Diff line number Diff line change
@@ -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:
Expand Down

0 comments on commit 6dcf55a

Please sign in to comment.