Skip to main content

markdown-to-respec

Build Status

markdown-to-respec is a Github Action for automatically publishing Markdown files as ReSpec HTML. The idea is that it is easier to edit and manage specifications in Markdown, but that it's easier to read specifications in your browser as HTML. By using markdown-to-respec you can have every commit to your Markdown trigger a rebuild of your HTML specifications.

As a (silly) example this Markdown file will generate this ReSpec HTML.

For the action to push to your branch you will need to grant write permission in Settings / Actions / General / Read and write permissions. Then you will need to create a .github/workflows/respec.yml file in your repository which contains:

name: Publish Specs
on:
  push:
    branches: 
      - main
jobs:
  respec:
    runs-on: ubuntu-latest
    name: Builds the ReSpec HTML
    steps:
      - name: Checkout
        uses: actions/checkout@v2
      - name: Generate ReSpec HTML
        uses: webrecorder/markdown-to-respec@v0.4.0

Action Options

The action takes several options which you can specify using the with clause in your markdown-to-respec step:

  • publish_branch: the branch to push the changes to (default gh-pages)
  • markdown_dir: if you want to limit the processing to a particular directory (default .)

For example, to publish to another branch using an alternate build of respec_js using Markdown files in the docs directory you would:

name: Publish Specs
on:
  - push:
      branches:
        - main
jobs:
  respec:
    runs-on: ubuntu-latest
    name: Builds the ReSpec HTML
    steps:
      - name: Checkout
        uses: actions/checkout@v2
      - name: Generate ReSpec HTML
        uses: webrecorder/markdown-to-respec@v0.1.0
        with:
          publish_branch: web
          markdown_dir: docs

ReSpec Configuration

ReSpec is usually configured with a JSON object in order to set authors, editors, various version URLs, etc. You have two options for these.

  1. Include as frontmatter in your Markdown file: see embedded for an example.
  2. Include as a JSON file along side your Markdown file: see external for an example.

If you would like to use an alternate ReSpec Javascript URL you can use the respec_js config option either in frontmatter or the external JSON configuration.

Command Line

If you want you can install markdown-to-respec and run it from the command line. This can be useful in situations where you are making local changes and want to see the resulting HTML. You should be able to use your browser to open the resulting HTML files.

usage: markdown-to-respec [-h] [--branch BRANCH] [--publish] [--ignore IGNORE] path

positional arguments:
  path             Path to search for Markdown files

options:
  -h, --help       show this help message and exit
  --branch BRANCH  Git branch to publish to
  --publish        Commit and push new HTML files
  --ignore IGNORE  A regex of Markdown files to ignore

Metadata

Release files for markdown-to-respec 0.4.1

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

Source distribution (sdist)

Source distribution for markdown-to-respec 0.4.1
File Size Uploaded
markdown-to-respec-0.4.1.tar.gz 5.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for markdown-to-respec 0.4.1
File Interpreter ABI Platform
markdown_to_respec-0.4.1-py3-none-any.whl Python 3 none any Details

Total release size: 10.4 kB

Release files / markdown-to-respec-0.4.1.tar.gz

Download URL markdown-to-respec-0.4.1.tar.gz
Size 5.0 kB
Tags Source
SHA-256 checksum
How to use checksums
aada8e945723ce889a0a5404b624a6471003620906db8dbc280b6eedf1d1e873
BLAKE2b-256 checksum
How to use checksums
5efb263f39d091064f74e666bc5148f51ae872d1c07cd4bf9e82e283e8208892
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.2

Release files / markdown_to_respec-0.4.1-py3-none-any.whl

Download URL markdown_to_respec-0.4.1-py3-none-any.whl
Size 5.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f2e98731c5af8ab5ee46f2026fdbc2f865813343e28ffb15d1b07263d2648126
BLAKE2b-256 checksum
How to use checksums
61d2fe54550317b59431032d3716fa02365c9f83881dbe03889fe7d6de04639d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.2

Release history Release notifications | RSS feed

This release

0.4.1 This release

2 release files

0.3.0

2 release files

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