bitovi / bitovi/documentjs

Auto copy demos to output folder

Open
#198 1 comment 0 reactions 0 assignees View on GitHub
feature
Dominant language
JavaScript
Stars
598
Forks
371
PR merge metrics
No merged PRs in 30d

Description

DocumentJS currently does not move the demos into the output folder and this makes it difficult to add demos to the generated docs. One can do it manually, but I've taken to creating a `grunt` task that handles this. This seems like a basic missing feature.
### Suggestion

The `@demo` tag should point to the current location of the demo file and then DocumentJS should grab the file and move it to a common `demos` folder inside the output folder. Then it would update the relative link to the demo in the outputted HTML.

For example

```
@demo demos/bootstrap/components/grid.html
```

Would get copied to:

```
/output/folder/demos/bootstrap/components/grid.html
```

Also possible that we should rename the demo files (to avoid name conflicts) and put them all in the `demo` folder flat. I don't think this would cause any problems. That way, the user can put the demo file wherever they want and DocJS copys/moves/renames it and updates the link.

Ref https://github.com/bitovi/documentjs/issues/116

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by tracing how the @demo tag is processed and how output HTML links are generated; the issue does not name specific files or tests. Review the related issue 116 and decide whether demos preserve their paths or are flattened. Done means referenced demos are copied into the output demos folder and generated HTML links point to them.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
documentation
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.