Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: DavidWells/markdown-magic
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.1.20
Choose a base ref
...
head repository: DavidWells/markdown-magic
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Loading
Showing with 12,059 additions and 1,111 deletions.
  1. +0 −2 .eslintignore
  2. +0 −28 .eslintrc
  3. +1 −0 .github/FUNDING.yml
  4. +40 −0 .github/workflows/test.yml
  5. +116 −2 .gitignore
  6. +0 −10 .travis.yml
  7. +54 −0 NOTES.md
  8. +378 −122 README.md
  9. +10 −83 cli.js
  10. +6 −0 examples/0_zero-config.js
  11. +2 −1 examples/{basic-usage.js → 1-_basic-usage.js}
  12. +24 −0 examples/1_simple.js
  13. +12 −0 examples/2_with-options.js
  14. +87 −29 examples/generate-readme.js
  15. +0 −14 examples/package.json
  16. +2 −3 examples/plugin-example.js
  17. +0 −46 index.js
  18. +171 −0 lib/block-parser-js.test.js
  19. +386 −0 lib/block-parser.js
  20. +481 −0 lib/block-parser.test.js
  21. +324 −0 lib/cli.js
  22. +409 −0 lib/cli.test.js
  23. +12 −0 lib/defaults.js
  24. +701 −0 lib/index.js
  25. +11 −0 lib/index.test.js
  26. +430 −0 lib/process-contents.js
  27. +66 −0 lib/process-file.js
  28. +0 −123 lib/processFile.js
  29. +0 −52 lib/transforms/code.js
  30. +202 −0 lib/transforms/code/index.js
  31. +362 −0 lib/transforms/code/resolve-github-file.js
  32. +32 −0 lib/transforms/code/resolve-github-file.test.js
  33. +39 −0 lib/transforms/file.js
  34. +54 −22 lib/transforms/index.js
  35. +9 −8 lib/transforms/remote.js
  36. +18 −0 lib/transforms/sectionToc.js
  37. +29 −25 lib/transforms/toc.js
  38. +5 −0 lib/transforms/wordCount.js
  39. +11 −0 lib/types.js
  40. +0 −121 lib/updateContents.js
  41. +183 −0 lib/utils/fs.js
  42. +109 −0 lib/utils/fs.test.js
  43. +28 −0 lib/utils/hash-file.js
  44. +19 −0 lib/utils/index.js
  45. +2 −6 cli-utils.js → lib/utils/load-config.js
  46. +108 −0 lib/utils/logs.js
  47. +84 −0 lib/utils/regex-timeout.js
  48. +102 −8 lib/utils/regex.js
  49. +91 −6 lib/utils/remoteRequest.js
  50. +0 −1 lib/utils/sortOrder.js
  51. +83 −0 lib/utils/syntax.js
  52. +356 −0 lib/utils/text.js
  53. +305 −0 lib/utils/text.test.js
  54. +315 −0 lib/utils/toc.js
  55. +131 −0 lib/utils/toposort.js
  56. +0 −12 markdown.config.js
  57. +21 −0 md.config.js
  58. +3,877 −0 package-lock.json
  59. +43 −25 package.json
  60. +10 −0 test/config.js
  61. +73 −0 test/errors.test.js
  62. +0 −13 test/fixtures/CODE-test.md
  63. +0 −12 test/fixtures/REMOTE-test.md
  64. +0 −34 test/fixtures/TOC-test.md
  65. +0 −9 test/fixtures/custom-match-word-test.md
  66. +39 −0 test/fixtures/js/simple.js
  67. +6 −0 test/fixtures/local-code-file-lines.js
  68. +10 −0 test/fixtures/local-code-file.js
  69. +36 −0 test/fixtures/local-code-id.js
  70. +21 −0 test/fixtures/md/basic.md
  71. +16 −0 test/fixtures/md/broken-inline.md
  72. +32 −0 test/fixtures/md/error-missing-transforms-two.md
  73. +32 −0 test/fixtures/md/error-missing-transforms.md
  74. +22 −0 test/fixtures/md/error-no-block-transform-defined.md
  75. +10 −0 test/fixtures/md/error-unbalanced.md
  76. +13 −0 test/fixtures/md/format-inline.md
  77. +69 −0 test/fixtures/md/format-with-wacky-indentation.md
  78. +22 −0 test/fixtures/md/inline-two.md
  79. +3 −0 test/fixtures/md/inline.md
  80. +58 −0 test/fixtures/md/mdx-file.mdx
  81. +32 −0 test/fixtures/md/missing-transform.md
  82. +10 −0 test/fixtures/md/mixed.md
  83. +21 −0 test/fixtures/md/nested/nested.md
  84. +13 −0 test/fixtures/md/no-transforms.md
  85. +5 −0 test/fixtures/md/string.md
  86. +9 −0 test/fixtures/md/syntax-legacy-colon.md
  87. +9 −0 test/fixtures/md/syntax-legacy-query.md
  88. +17 −0 test/fixtures/md/syntax-mixed.md
  89. +166 −0 test/fixtures/md/transform-code.md
  90. +13 −0 test/fixtures/md/transform-custom.md
  91. +24 −0 test/fixtures/md/transform-file.md
  92. +467 −0 test/fixtures/md/transform-remote.md
  93. +83 −0 test/fixtures/md/transform-toc.md
  94. +9 −0 test/fixtures/md/transform-wordCount.md
  95. +0 −9 test/fixtures/nested/file.md
  96. +0 −94 test/fixtures/test.md
  97. +0 −191 test/test.js
  98. +192 −0 test/transforms.test.js
  99. +9 −0 test/utils/chalk.js
  100. +136 −0 test/utils/diff.js
  101. +31 −0 tsconfig.json
2 changes: 0 additions & 2 deletions .eslintignore

This file was deleted.

28 changes: 0 additions & 28 deletions .eslintrc

This file was deleted.

1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
github: [davidwells]
40 changes: 40 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Test
on:
push:
pull_request:
env:
FORCE_COLOR: 2
jobs:
full:
name: Node.js 15 Full
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v2
- name: Install Node.js
uses: actions/setup-node@v2
with:
node-version: 15
- name: Install dependencies
uses: bahmutov/npm-install@v1
- name: Run tests
run: npm test
short:
runs-on: ubuntu-latest
strategy:
matrix:
node-version:
- 14
- 12
name: Node.js ${{ matrix.node-version }} Quick
steps:
- name: Checkout the repository
uses: actions/checkout@v2
- name: Install Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
uses: bahmutov/npm-install@v1
- name: Run unit tests
run: npm test
118 changes: 116 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,116 @@
node_modules
npm-debug.log
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

test/fixtures/output
_out.md
misc
misc/**/**.js
__misc

/**/old-test/cool.md

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# TypeScript v1 declaration files
typings/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env
.env.test

# parcel-bundler cache (https://parceljs.org/)
.cache

# next.js build output
.next

# nuxt.js build output
.nuxt

# vuepress build output
.vuepress/dist

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# General
.DS_Store
.AppleDouble
.LSOverride

# Icon must end with two \r
Icon


# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
10 changes: 0 additions & 10 deletions .travis.yml

This file was deleted.

54 changes: 54 additions & 0 deletions NOTES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@


## Using with MDX

- https://github.com/leebyron/remark-comment

## Alternative md parsers

- https://github.com/egoist/maid/blob/master/lib/parseMarkdown.js
- https://github.com/passcod/quenya#usage

## Cool markdown resources

- Markwhen is a text-to-timeline tool. You write markdown-ish text and it gets converted into a nice looking cascading timeline. https://markwhen.com/
- Run tests from markdown https://github.com/Widdershin/markdown-doctest/blob/master/src/doctest.ts
- Generate markdown documentation based on TS Inference and JSDoc https://github.com/geut/apiness

## Additional transforms

- Use values from pkg json https://github.com/forresst/markdown-magic-package-json + example: https://github.com/CambridgeMonorail/ng-guitar/blame/69935847b28e5c8fd0280e0de059de29e7988efa/README.md#L30
- https://github.com/dineshsonachalam/markdown-autodocs#json-to-html-table + https://github.com/dineshsonachalam/repo-using-markdown-autodocs
- Last updated: https://github.com/puntorigen/puntorigen/blob/main/markdown.config.js#L28 based on run
- Last modified based on git https://github.com/camacho/markdown-magic-last-modified/blob/master/index.js
- Automatically output CLI help https://github.com/ljharb/can-merge/blob/main/markdown.config.js#L9 + https://github.com/rafaelrr1/prototipado/blob/7bb071dd4a95e46b7e98397e3447e0f3c6286ba5/bower_components/mocha/scripts/markdown-magic.config.js#L20-L32
- https://github.com/camacho?tab=repositories&q=markdown&type=&language=&sort=
- NPM package scripts https://github.com/camacho/markdown-magic-package-scripts/blob/master/index.js
- Insert benchmarks https://github.com/velveteer/hermes/blame/23f00246c764170529575e66688b5e3ac19e8511/README.md#L66
- Meeting agendas https://github.com/TopDev-727/Agendas-Reactjs/blob/main/README.md + https://github.com/TopDev-727/Agendas-Reactjs/blame/main/README.md#L5
- Inline type references https://github.com/orta/markdown-magic-inline-types
- JSdoc to md from file path https://github.com/bradtaylorsf/markdown-magic-jsdoc + https://github.com/imperva/google-analytics-spa/blame/master/README.md#L162
- List organization repos https://github.com/tripflex/awesome-mongoose-os/tree/4fd8f1023e532d1dde623a35d69b7920402f0203#L28
- Directory tree https://github.com/willsaavedra/tweet-project/blob/06c1f342fb333320e15d70a6944312dfd6451833/src/doc-directory-tree.js
- Exec command and output std? https://github.com/yuanqing/markdown-interpolate
- tweets? https://github.com/zernonia/tweetic
- Array tables https://github.com/iaseth/readmix/blob/43ce5def6f4caade32249b6cf2ecec7d130fecce/src/mixins/table/table.ts#L9

## Ideas

- Dep svg https://github.com/dyatko/arkit
- Content graph https://github.com/mattpocock/graph-docs-cli
- Visualize content graph tree https://github.com/dundalek/markmap or https://github.com/markmap/markmap or https://github.com/pahen/madge
- For github action https://github.com/gautamkrishnar/blog-post-workflow/blob/c663c4bcbbcf114b98994d611903cdd3d781aec1/src/utils.js#L97-L119
- Visualizations https://github.com/lowlighter/metrics
- Code images https://satori-syntax-highlighter.vercel.app/
- Repo visualizer https://github.com/githubocto/repo-visualizer
- Include md helpers https://www.npmjs.com/package/markdown-utils
- VScode plugin https://github.com/mohitsinghs/vscode-markdoc/blob/d7bf7d439e1d647acc2fa956b33cf26d1c6fa4ea/syntaxes/markdoc.tmLanguage.json#L2973
- Typedoc output https://github.com/tgreyuk/typedoc-plugin-markdown/tree/master/packages/typedoc-plugin-markdown
- Exec output https://github.com/cdklabs/markmac

## Workflow?

- https://github.com/EndBug/add-and-commit
- https://github.com/gautamkrishnar/blog-post-workflow/
Loading