-
Notifications
You must be signed in to change notification settings - Fork 0
Fixes for ogma #2
base: master
Are you sure you want to change the base?
Conversation
README.md
Outdated
@@ -1,3 +1,29 @@ | |||
### 🎯 Purpose of this branch | |||
|
|||
Reproduce issues that I currently encounter when generating documentation with documentation.js |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This stuff is better to put in the PR description, then you can use checkboxes etc
@@ -25,6 +25,7 @@ | |||
"highlight.js": "^11.3.1", | |||
"ini": "^2.0.0", | |||
"js-yaml": "^4.1.0", | |||
"konan": "^2.1.1", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you need this one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah I see, it's from the original repo
src/default_theme/hierarchy._
Outdated
@@ -0,0 +1,19 @@ | |||
<section class='py2 clearfix'> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's better to move this stuff to src/ogma_theme
for now
src/default_theme/index._
Outdated
@@ -27,68 +27,84 @@ | |||
type='text' /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this TOC file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It generates the final html file, it contains :
- the left section (the TOC and the search bar)
- the right section (the whole list of documented entities)
- some js and css files
src/default_theme/index.js
Outdated
sharedImports.imports.renderHierarchy = template( | ||
await fs.readFile(path.join(__dirname, 'hierarchy._'), 'utf8'), | ||
sharedImports | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
src/extractors/exported.js
Outdated
if ( | ||
path.node.leadingComments && | ||
path.node.leadingComments | ||
.map(({ value }) => value.match(/^ *\*\*? ?@inner/)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This regexp should be declared somewhere outside and given a readable name (IS_INNER_RE
)
.map(segment => ({ scope: 'static', name: segment })); | ||
path = comment.memberof.split('.').map(segment => ({ | ||
scope: 'static', | ||
// remove $1 at the end of the name |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can make it a function with a name like sanitizeLocalName
@@ -221,6 +222,29 @@ export default function (comments) { | |||
return memo + scopeChar + part.name; | |||
}, ''); | |||
|
|||
// TODO: move this example out of this file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, this should be some post or pre-processing, do they have an API for that?
@@ -97,7 +97,7 @@ const flatteners = { | |||
result.kind = 'event'; | |||
|
|||
if (tag.description) { | |||
result.name = tag.description; | |||
result.name = tag.description.split('\n')[0]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it safe?
*/ | ||
function retrieveDescriptionNextToTags(rawComment, tags) { | ||
// regex to retreive the whole description string (new lines included) | ||
const descLines = new RegExp( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should it be something that matches "from one tag to another"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
?
…Options properties)
These changes are specific to Ogma: