Skip to content

Commit

Permalink
feat: use reference links for Markdown output, improving brevity
Browse files Browse the repository at this point in the history
* Use reference links in Markdown.

Fixes #948.

This approach might be problematic when inserting markdown under a readme heading if the readme already has link references with conflicting ID’s.

* Reference links edits:

- fix broken normalize() utility in test suite so that it produces
  output that doesn't choke referenceLinks.
- add DocumentationConfig option `--noReferenceLinks` which will be
  **internal only**, and turns off reference links for `readme` mode
- rebuilds test output with these changes

unrelated but minor

- includes .prettierrc and updates calls to prettier to use that instead
  of CLI options

* chore: update test snapshots

* Update readme snap
  • Loading branch information
tmcw committed Mar 1, 2018
1 parent 64f660d commit ab494dd
Show file tree
Hide file tree
Showing 10 changed files with 1,005 additions and 582 deletions.
3 changes: 3 additions & 0 deletions .prettierrc
@@ -0,0 +1,3 @@
{
"singleQuote": true
}
138 changes: 102 additions & 36 deletions __tests__/__snapshots__/bin.js.snap
Expand Up @@ -1769,36 +1769,36 @@ exports[`build --document-exported 1`] = `
### Table of Contents
- [z](#z)
- [zMethod](#zmethod)
- [x](#x)
- [Class](#class)
- [classMethod](#classmethod)
- [classGetter](#classgetter)
- [classSetter](#classsetter)
- [staticMethod](#staticmethod)
- [staticGetter](#staticgetter)
- [staticSetter](#staticsetter)
- [T5](#t5)
- [y2Default](#y2default)
- [y4](#y4)
- [object](#object)
- [method](#method)
- [getter](#getter)
- [setter](#setter)
- [prop](#prop)
- [func](#func)
- [f1](#f1)
- [f3](#f3)
- [T](#t)
- [T2](#t2)
- [T4](#t4)
- [f4](#f4)
- [o1](#o1)
- [om1](#om1)
- [f5](#f5)
- [o2](#o2)
- [om2](#om2)
- [z][1]
- [zMethod][2]
- [x][3]
- [Class][4]
- [classMethod][5]
- [classGetter][6]
- [classSetter][7]
- [staticMethod][8]
- [staticGetter][9]
- [staticSetter][10]
- [T5][11]
- [y2Default][12]
- [y4][13]
- [object][14]
- [method][15]
- [getter][16]
- [setter][17]
- [prop][18]
- [func][19]
- [f1][20]
- [f3][21]
- [T][22]
- [T2][23]
- [T4][24]
- [f4][25]
- [o1][26]
- [om1][27]
- [f5][28]
- [o2][29]
- [om2][30]
## z
Expand All @@ -1814,7 +1814,7 @@ exports[`build --document-exported 1`] = `
**Parameters**
- \`a\` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**
- \`a\` **[string][31]**
### classMethod
Expand All @@ -1838,7 +1838,7 @@ exports[`build --document-exported 1`] = `
## T5
Type: [boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)
Type: [boolean][32]
## y2Default
Expand All @@ -1848,7 +1848,7 @@ Description of y3
**Parameters**
- \`p\` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)**
- \`p\` **[number][33]**
Returns **void**
Expand All @@ -1874,15 +1874,15 @@ Returns **void**
## T
Type: [number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)
Type: [number][33]
## T2
Type: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)
Type: [string][31]
## T4
Type: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)
Type: [string][31]
## f4
Expand All @@ -1905,6 +1905,72 @@ f5 comment
## o2
### om2
[1]: #z
[2]: #zmethod
[3]: #x
[4]: #class
[5]: #classmethod
[6]: #classgetter
[7]: #classsetter
[8]: #staticmethod
[9]: #staticgetter
[10]: #staticsetter
[11]: #t5
[12]: #y2default
[13]: #y4
[14]: #object
[15]: #method
[16]: #getter
[17]: #setter
[18]: #prop
[19]: #func
[20]: #f1
[21]: #f3
[22]: #t
[23]: #t2
[24]: #t4
[25]: #f4
[26]: #o1
[27]: #om1
[28]: #f5
[29]: #o2
[30]: #om2
[31]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String
[32]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean
[33]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number
"
`;
Expand Down

0 comments on commit ab494dd

Please sign in to comment.