Coder Social home page Coder Social logo

tbnorth / pymd_helper Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 14 KB

Python GitHub Markdown helper - include files in markdown, table of contents, etc.

License: MIT License

Python 100.00%
github-markdown table-of-contents markdown-include pymd-helper

pymd_helper's Introduction

pymd_helper

Python GitHub Markdown helper - include files in markdown, table of contents, etc.

Overview

pymd_helper uses specially formatted markdown comments (<!-- |cmd,args... -->) to enrich markdown documentation in git repositories (GitHub, etc.). pymd_helper can insert files into code blocks to keep documentation in sync. with actual code, and generate a table of contents.

Available commands

Insert a file insert

    <!-- |insert,src=examples/script.sh,syntax=shell,addpath -->

will insert the contents of the file script.sh in a markdown code block with shell syntax highlighting:

# this isn't a real script
ARG1=$1
cp $ARG1 /dev/null
echo "Copy complete"

The presence of the addpath parameter controls the presence of the (examples/script.sh) link preceding the code block. type=comment can be added to the |insert command line to insert a <!-- --> comment block rather than a code block.

Insert a table of contents toc

   <!-- |toc -->

will generate a table of contents for the markdown headings (#, ##, โ€ฆ) in the remainder of the markdown file.

Insert documentation about this documentation system documentation

    <!-- |documentation -->

will insert the following comment in your markdown.

<!-- Please see https://github.com/tbnorth/pymd_helper for instructions on
     updating this projects markdown files.  `pymd_helper` is used to
     insert/update files into markdown documentation, generate tables
     of contents, etc.
-->

This comment is not visible to people viewing the repository's rendered markdown, but provides information for people updating the markdown directly.

How it works

Similar tools

To do

  • write preceding sections
  • add line / regex ranges for |insert
  • add docker container for zero install usage on systems with docker
  • add tests
  • add file recursion in |toc generation

pymd_helper's People

Contributors

tbnorth avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.