diff --git a/contributing/index.html b/contributing/index.html new file mode 100644 index 0000000..24c6ad0 --- /dev/null +++ b/contributing/index.html @@ -0,0 +1,4526 @@ + + + + + + + + + + + + Contributing | mmdoc + + + +
+ + + +
+
+

+Contributing +

+

For easy development, nix with flakes support is recommended.

+

+Test +

+

Compile and run the test suite with:

+
$ nix build
+
+

or

+
$ mkdir build && cd build
+$ meson ..
+$ ninja test
+
+

Format

+
$ nix fmt
+
+

Documentation

+

Build the mmdoc docs to ./result with:

+
$ nix develop -c doc-build
+
+

Continuosly build the mmdoc docs and serve them on port 8000 with:

+
$ nix develop -c doc-watch
+
+

Nixpkgs manual

+

This is a temporary test that is in place while mmdoc is developed in tandem with the conversion of the nixpkgs manual to use Markdown. You can build my branch of nixpkgs-manual with:

+

Build the nixpkgs manual at ./result with:

+
$ nix develop -c np-build
+
+

Continuosly build the nixpkgs manual and serve them on port 8000 with:

+
$ nix develop -c np-watch
+
+

Making a new release

+
    +
  1. run ./contrib/release {major.minor.patch}. For example, ./contrib/release 0.16.0.
  2. +
  3. edit commit message
  4. +
  5. push commit and tags to GitHub
  6. +
+
+ +
+ + + +
+ + diff --git a/favicon.svg b/favicon.svg new file mode 100644 index 0000000..82ca1b6 --- /dev/null +++ b/favicon.svg @@ -0,0 +1,68 @@ + + + + + + + + image/svg+xml + + + + + + + + mm + + diff --git a/features/index.html b/features/index.html new file mode 100644 index 0000000..beef9c0 --- /dev/null +++ b/features/index.html @@ -0,0 +1,4496 @@ + + + + + + + + + + + + Features | mmdoc + + + +
+ + + +
+
+

+Features +

+
    +
  • No options.
  • +
  • Fast: written in C, using cmark a very fast Markdown parser/renderer.
  • +
  • The HTML documents have syntax highlighting via highlight.js.
  • +
  • The multi-page HTML documents have full-text search via fuse.js.
  • +
+
+ +
+ + + +
+ + diff --git a/fuse.basic.min.js b/fuse.basic.min.js new file mode 100644 index 0000000..89477c6 --- /dev/null +++ b/fuse.basic.min.js @@ -0,0 +1,9 @@ +/** + * Fuse.js v6.6.2 - Lightweight fuzzy-search (http://fusejs.io) + * + * Copyright (c) 2022 Kiro Risk (http://kiro.me) + * All Rights Reserved. Apache Software License 2.0 + * + * http://www.apache.org/licenses/LICENSE-2.0 + */ +var e,t;e=this,t=function(){"use strict";function e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function t(t){for(var n=1;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3,n=new Map,r=Math.pow(10,t);return{get:function(t){var i=t.match(_).length;if(n.has(i))return n.get(i);var o=1/Math.pow(i,.5*e),a=parseFloat(Math.round(o*r)/r);return n.set(i,a),a},clear:function(){n.clear()}}}var O=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.getFn,i=void 0===n?L.getFn:n,o=t.fieldNormWeight,a=void 0===o?L.fieldNormWeight:o;r(this,e),this.norm=S(a,3),this.getFn=i,this.isCreated=!1,this.setIndexRecords()}return o(e,[{key:"setSources",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.docs=e}},{key:"setIndexRecords",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.records=e}},{key:"setKeys",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.keys=t,this._keysMap={},t.forEach((function(t,n){e._keysMap[t.id]=n}))}},{key:"create",value:function(){var e=this;!this.isCreated&&this.docs.length&&(this.isCreated=!0,u(this.docs[0])?this.docs.forEach((function(t,n){e._addString(t,n)})):this.docs.forEach((function(t,n){e._addObject(t,n)})),this.norm.clear())}},{key:"add",value:function(e){var t=this.size();u(e)?this._addString(e,t):this._addObject(e,t)}},{key:"removeAt",value:function(e){this.records.splice(e,1);for(var t=e,n=this.size();t2&&void 0!==arguments[2]?arguments[2]:{},r=n.getFn,i=void 0===r?L.getFn:r,o=n.fieldNormWeight,a=void 0===o?L.fieldNormWeight:o,c=new O({getFn:i,fieldNormWeight:a});return c.setKeys(e.map(k)),c.setSources(t),c.create(),c}function j(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.errors,r=void 0===n?0:n,i=t.currentLocation,o=void 0===i?0:i,a=t.expectedLocation,c=void 0===a?0:a,s=t.distance,h=void 0===s?L.distance:s,u=t.ignoreLocation,l=void 0===u?L.ignoreLocation:u,d=r/e.length;if(l)return d;var f=Math.abs(c-o);return h?d+f/h:f?1:d}function E(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:L.minMatchCharLength,n=[],r=-1,i=-1,o=0,a=e.length;o=t&&n.push([r,i]),r=-1)}return e[o-1]&&o-r>=t&&n.push([r,o-1]),n}var I=32;function F(e){for(var t={},n=0,r=e.length;n1&&void 0!==arguments[1]?arguments[1]:{},o=i.location,a=void 0===o?L.location:o,c=i.threshold,s=void 0===c?L.threshold:c,h=i.distance,u=void 0===h?L.distance:h,l=i.includeMatches,d=void 0===l?L.includeMatches:l,f=i.findAllMatches,v=void 0===f?L.findAllMatches:f,g=i.minMatchCharLength,y=void 0===g?L.minMatchCharLength:g,p=i.isCaseSensitive,m=void 0===p?L.isCaseSensitive:p,b=i.ignoreLocation,k=void 0===b?L.ignoreLocation:b;if(r(this,e),this.options={location:a,threshold:s,distance:u,includeMatches:d,findAllMatches:v,minMatchCharLength:y,isCaseSensitive:m,ignoreLocation:k},this.pattern=m?t:t.toLowerCase(),this.chunks=[],this.pattern.length){var M=function(e,t){n.chunks.push({pattern:e,alphabet:F(e),startIndex:t})},w=this.pattern.length;if(w>I){for(var x=0,_=w%I,S=w-_;x3&&void 0!==arguments[3]?arguments[3]:{},i=r.location,o=void 0===i?L.location:i,a=r.distance,c=void 0===a?L.distance:a,s=r.threshold,h=void 0===s?L.threshold:s,u=r.findAllMatches,l=void 0===u?L.findAllMatches:u,d=r.minMatchCharLength,f=void 0===d?L.minMatchCharLength:d,v=r.includeMatches,g=void 0===v?L.includeMatches:v,y=r.ignoreLocation,m=void 0===y?L.ignoreLocation:y;if(t.length>I)throw new Error(p(I));for(var b,k=t.length,M=e.length,w=Math.max(0,Math.min(o,M)),x=h,_=w,S=f>1||g,O=S?Array(M):[];(b=e.indexOf(t,_))>-1;){var A=j(t,{currentLocation:b,expectedLocation:w,distance:c,ignoreLocation:m});if(x=Math.min(A,x),_=b+k,S)for(var F=0;F=T;R-=1){var U=R-1,B=n[e.charAt(U)];if(S&&(O[U]=+!!B),J[R]=(J[R+1]<<1|1)&B,$&&(J[R]|=(C[R+1]|C[R])<<1|1|C[R+1]),J[R]&W&&(N=j(t,{errors:$,currentLocation:U,expectedLocation:w,distance:c,ignoreLocation:m}))<=x){if(x=N,(_=U)<=w)break;T=Math.max(1,2*w-_)}}if(j(t,{errors:$+1,currentLocation:w,expectedLocation:w,distance:c,ignoreLocation:m})>x)break;C=J}var V={isMatch:_>=0,score:Math.max(.001,N)};if(S){var q=E(O,f);q.length?g&&(V.indices=q):V.isMatch=!1}return V}(e,n,i,{location:a+o,distance:s,threshold:h,findAllMatches:u,minMatchCharLength:l,includeMatches:r,ignoreLocation:d}),m=y.isMatch,b=y.score,k=y.indices;m&&(g=!0),v+=b,m&&k&&(f=[].concat(c(f),c(k)))}));var y={isMatch:g,score:g?v/this.chunks.length:1};return g&&r&&(y.indices=f),y}}]),e}(),N=[];function P(e,t){for(var n=0,r=N.length;n-1&&(n.refIndex=e.idx),t.matches.push(n)}}))}function D(e,t){t.score=e.score}function K(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.includeMatches,i=void 0===r?L.includeMatches:r,o=n.includeScore,a=void 0===o?L.includeScore:o,c=[];return i&&c.push($),a&&c.push(D),e.map((function(e){var n=e.idx,r={item:t[n],refIndex:n};return c.length&&c.forEach((function(t){t(e,r)})),r}))}var T=function(){function e(n){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2?arguments[2]:void 0;if(r(this,e),this.options=t(t({},L),i),this.options.useExtendedSearch)throw new Error(y);this._keyStore=new b(this.options.keys),this.setCollection(n,o)}return o(e,[{key:"setCollection",value:function(e,t){if(this._docs=e,t&&!(t instanceof O))throw new Error("Incorrect 'index' type");this._myIndex=t||A(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}},{key:"add",value:function(e){f(e)&&(this._docs.push(e),this._myIndex.add(e))}},{key:"remove",value:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){return!1},t=[],n=0,r=this._docs.length;n1&&void 0!==arguments[1]?arguments[1]:{},n=t.limit,r=void 0===n?-1:n,i=this.options,o=i.includeMatches,a=i.includeScore,c=i.shouldSort,s=i.sortFn,h=i.ignoreFieldNorm,d=u(e)?u(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e);return W(d,{ignoreFieldNorm:h}),c&&d.sort(s),l(r)&&r>-1&&(d=d.slice(0,r)),K(d,this._docs,{includeMatches:o,includeScore:a})}},{key:"_searchStringList",value:function(e){var t=P(e,this.options),n=this._myIndex.records,r=[];return n.forEach((function(e){var n=e.v,i=e.i,o=e.n;if(f(n)){var a=t.searchIn(n),c=a.isMatch,s=a.score,h=a.indices;c&&r.push({item:n,idx:i,matches:[{score:s,value:n,norm:o,indices:h}]})}})),r}},{key:"_searchLogical",value:function(e){throw new Error("Logical search is not available")}},{key:"_searchObjectList",value:function(e){var t=this,n=P(e,this.options),r=this._myIndex,i=r.keys,o=r.records,a=[];return o.forEach((function(e){var r=e.$,o=e.i;if(f(r)){var s=[];i.forEach((function(e,i){s.push.apply(s,c(t._findMatches({key:e,value:r[i],searcher:n})))})),s.length&&a.push({idx:o,item:r,matches:s})}})),a}},{key:"_findMatches",value:function(e){var t=e.key,n=e.value,r=e.searcher;if(!f(n))return[];var i=[];if(h(n))n.forEach((function(e){var n=e.v,o=e.i,a=e.n;if(f(n)){var c=r.searchIn(n),s=c.isMatch,h=c.score,u=c.indices;s&&i.push({score:h,key:t,value:n,idx:o,norm:a,indices:u})}}));else{var o=n.v,a=n.n,c=r.searchIn(o),s=c.isMatch,u=c.score,l=c.indices;s&&i.push({score:u,key:t,value:o,norm:a,indices:l})}return i}}]),e}();return T.version="6.6.2",T.createIndex=A,T.parseIndex=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.getFn,r=void 0===n?L.getFn:n,i=t.fieldNormWeight,o=void 0===i?L.fieldNormWeight:i,a=e.keys,c=e.records,s=new O({getFn:r,fieldNormWeight:o});return s.setKeys(a),s.setIndexRecords(c),s},T.config=L,T},"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).Fuse=t(); \ No newline at end of file diff --git a/index.html b/index.html new file mode 100644 index 0000000..f8234ed --- /dev/null +++ b/index.html @@ -0,0 +1,4535 @@ + + + + + + + + + + + + Introduction | mmdoc + + + +
+ + + +
+
+

+Introduction +

+
+

Minimal Markdown Documentation

+
+

Given a table of contents Markdown file, and some other Markdown files, generate:

+
    +
  • A single-page HTML document
  • +
  • Multi-page HTML documents, with full-text search
  • +
+
$ mmdoc project_name src_dir out_dir
+
+

For example:

+
$ mmdoc mmdoc doc out
+
+

takes a directory like

+
doc
+├── development.md
+├── features.md
+├── introduction.md
+├── license.md
+├── toc.md
+└── usage.md
+
+

and ouputs

+
out
+├── multi
+│   ├── development
+│   │   └── index.html
+│   ├── features
+│   │   └── index.html
+│   ├── fuse.basic.min.js
+│   ├── highlight.pack.js
+│   ├── index.html
+│   ├── license
+│   │   └── index.html
+│   ├── minimal.css
+│   ├── mono-blue.css
+│   ├── search_index.js
+│   ├── search.js
+│   └── usage
+│       └── index.html
+└── single
+    ├── highlight.pack.js
+    ├── index.html
+    ├── minimal.css
+    └── mono-blue.css
+
+
+ +
+ + + +
+ + diff --git a/install/index.html b/install/index.html new file mode 100644 index 0000000..d8d5208 --- /dev/null +++ b/install/index.html @@ -0,0 +1,4500 @@ + + + + + + + + + + + + Install | mmdoc + + + +
+ + + +
+
+

+Install +

+

With Nix, it is not necessary to install:

+
$ nix run github:ryantm/mmdoc -- <site name> <src> <out>
+
+

You could install with Nix via

+
$ nix profile install github:ryantm/mmdoc
+
+ +

Packaging in other repositories is welcome and will be added here as they're made known.

+
+ +
+ + + +
+ + diff --git a/license/index.html b/license/index.html new file mode 100644 index 0000000..ea7fa5d --- /dev/null +++ b/license/index.html @@ -0,0 +1,4502 @@ + + + + + + + + + + + + License | mmdoc + + + +
+ + + +
+
+

+License +

+

The mmdoc project is licensed under the "CC0 1.0 Universal". By contributing to this project, you agree to have your work licensed under that license.

+

Other licenses that might be relevant to this project:

+
    +
  • +

    highlight.js source code is merged into the mmdoc binary so that it can be used in the HTML outputs.

    +
  • +
  • +

    fuse.js source code is merged into the mmdoc binary so that it can be used in the HTML outputs.

    +
  • +
  • +

    Some styling and HTML DOM object layout are based on mdBook source code.

    +
  • +
+
+ +
+ + + +
+ + diff --git a/search_index.js b/search_index.js new file mode 100644 index 0000000..0f486ab --- /dev/null +++ b/search_index.js @@ -0,0 +1,8 @@ +const corpus = [{ "url": ".\/", "title": "Introduction", "text": "IntroductionMinimal Markdown Documentation\n\nGiven a table of contents Markdown file, and some other Markdown files, generate:\n\n - A single-page HTML document\n - Multi-page HTML documents, with full-text search\n\n$ mmdoc project_name src_dir out_dir\n\nFor example:\n\n$ mmdoc mmdoc doc out\n\ntakes a directory like\n\ndoc\n├── development.md\n├── features.md\n├── introduction.md\n├── license.md\n├── toc.md\n└── usage.md\n\nand ouputs\n\nout\n├── multi\n│   ├── development\n│   │   └── index.html\n│   ├── features\n│   │   └── index.html\n│   ├── fuse.basic.min.js\n│   ├── highlight.pack.js\n│   ├── index.html\n│   ├── license\n│   │   └── index.html\n│   ├── minimal.css\n│   ├── mono-blue.css\n│   ├── search_index.js\n│   ├── search.js\n│   └── usage\n│   └── index.html\n└── single\n ├── highlight.pack.js\n ├── index.html\n ├── minimal.css\n └── mono-blue.css\n" } +,{ "url": "features\/", "title": "Features", "text": "Features - No options.\n - Fast: written in C, using cmark a very fast Markdown parser\/renderer.\n - The HTML documents have syntax highlighting via highlight.js.\n - The multi-page HTML documents have full-text search via fuse.js.\n" } +,{ "url": "users\/", "title": "Users of mmdoc", "text": "Users of mmdoc - This manual!\n - Ryan's rendering of the Nixpkgs manual\n - Ryan's personal blog\n\nPlease contact me at ryan@ryantm.com or make an issue at https:\/\/github.com\/ryantm\/mmdoc.\n" } +,{ "url": "install\/", "title": "Install", "text": "InstallWith Nix, it is not necessary to install:\n\n$ nix run github:ryantm\/mmdoc -- \n\nYou could install with Nix via\n\n$ nix profile install github:ryantm\/mmdoc\n\n - mmdoc is packaged in Nixpkgs\n\nPackaging in other repositories is welcome and will be added here as they're made known.\n" } +,{ "url": "usage\/", "title": "Usage", "text": "Usagetoc.md\n\ntoc.md is a special file for mmdoc. The order of the cross references in toc.md control the order the sections appear in\nthe single-page HTML and ePub outputs. If a section is not referenced in toc.md it does not get included in any of the\noutputs.\n\nExtensions beyond CommonMark\n\nIn order to be useful for Documentation, it uses several CommonMark extensions available in GitHub-flavored Markdown and\nPandoc.\n\n - Cross references\n \n Made with:\n \n # Heading {#heading-anchor-id}\n [inline]{#inline-anchor-id}\n\n Referenced with:\n \n [heading](#heading-anchor-id)\n [inline](#inline-anchor-id)\n\n - GitHub tables\n \n | foo | bar |\n | --- | --- |\n | baz | bim |\n\n - Admonitions\n \n ::: warning\n this is your last warning\n :::\n\n this is your last warning \n \n ::: {.example #anchor}\n this is your last warning\n :::\n\n this is your last warning \n\n - DD Lists\n \n term 1\n \n : defintion 1\n \n term 2\n \n : defintion 2\n" } +,{ "url": "contributing\/", "title": "Contributing", "text": "ContributingFor easy development, nix with flakes support is recommended.\n\nTestCompile and run the test suite with:\n\n$ nix build\n\nor\n\n$ mkdir build && cd build\n$ meson ..\n$ ninja test\n\nFormat\n\n$ nix fmt\n\nDocumentation\n\nBuild the mmdoc docs to .\/result with:\n\n$ nix develop -c doc-build\n\nContinuosly build the mmdoc docs and serve them on port 8000 with:\n\n$ nix develop -c doc-watch\n\nNixpkgs manual\n\nThis is a temporary test that is in place while mmdoc is developed in tandem with the conversion of the nixpkgs manual\nto use Markdown. You can build my branch of nixpkgs-manual with:\n\nBuild the nixpkgs manual at .\/result with:\n\n$ nix develop -c np-build\n\nContinuosly build the nixpkgs manual and serve them on port 8000 with:\n\n$ nix develop -c np-watch\n\nMaking a new release\n\n1. run .\/contrib\/release {major.minor.patch}. For example, .\/contrib\/release 0.16.0.\n2. edit commit message\n3. push commit and tags to GitHub\n" } +,{ "url": "license\/", "title": "License", "text": "LicenseThe mmdoc project is licensed under the \"CC0 1.0 Universal\". By contributing to this project, you agree to have\nyour work licensed under that license.\n\nOther licenses that might be relevant to this project:\n\n - highlight.js source code is merged into the mmdoc binary so that it can be used in the HTML outputs.\n\n - fuse.js source code is merged into the mmdoc binary so that it can be used in the HTML outputs.\n\n - Some styling and HTML DOM object layout are based on mdBook source code.\n" } +] \ No newline at end of file diff --git a/usage/index.html b/usage/index.html new file mode 100644 index 0000000..a92990f --- /dev/null +++ b/usage/index.html @@ -0,0 +1,4546 @@ + + + + + + + + + + + + Usage | mmdoc + + + +
+ + + +
+
+

+Usage +

+

toc.md

+

toc.md is a special file for mmdoc. The order of the cross references in toc.md control the order the sections appear in the single-page HTML and ePub outputs. If a section is not referenced in toc.md it does not get included in any of the outputs.

+

Extensions beyond CommonMark

+

In order to be useful for Documentation, it uses several CommonMark extensions available in GitHub-flavored Markdown and Pandoc.

+
    +
  • +

    Cross references

    +

    Made with:

    +
    # Heading {#heading-anchor-id}
    +[inline]{#inline-anchor-id}
    +
    +

    Referenced with:

    +
    [heading](#heading-anchor-id)
    +[inline](#inline-anchor-id)
    +
    +
  • +
  • +

    GitHub tables

    +
    | foo | bar |
    +| --- | --- |
    +| baz | bim |
    +
    +
  • +
  • +

    Admonitions

    +
    ::: warning
    +this is your last warning
    +:::
    +
    +

    Warning

    +

    +this is your last warning +

    +
    +
    ::: {.example #anchor}
    +this is your last warning
    +:::
    +
    +

    Example

    +

    +this is your last warning +

    +
    +
  • +
  • +

    DD Lists

    +
    term 1
    +
    +: defintion 1
    +
    +term 2
    +
    +: defintion 2
    +
    +
  • +
+
+ +
+ + + +
+ + diff --git a/users/index.html b/users/index.html new file mode 100644 index 0000000..b8c2c33 --- /dev/null +++ b/users/index.html @@ -0,0 +1,4496 @@ + + + + + + + + + + + + Users of mmdoc | mmdoc + + + +
+ + + +
+
+

+Users of mmdoc +

+ +

Please contact me at ryan@ryantm.com or make an issue at https://github.com/ryantm/mmdoc.

+
+ +
+ + + +
+ +