* Fix bug Code block tabs broke the referenced links
- The reason is that the previous Codeblock implementation separates
the tabs, the markdown before tabs, and the markdown after tabs into
separate Remarkable component, thus they don't share information
regarding the reference link
- To solve this, change the Doc implementation so that one Doc
have only one Remarkable component by transforming the codeblock
into html string and add it as part of the markdown, letting the
Remarkable take care of the html string
- However, this approach made us need to ensure that there is no
newline in the codetab, otherwise, the formatting inside the
code will be broken. Thus, I replace every newline inside the
code tag with a br tag
Fix#1215
* Fix prettier
* Try to find a way to recognize the codeblock tabs, its title, and
where it ends
- I try using DOCUSAURUS_CODE_TABS to mark the start
- Use TAB_TITLE to mark the title of the tab
- END_TAB to mark the end of that tab
- END_DOCUSAURUS_CODE_TABS to mark the end of the whole code blocks
then parse using regex and render accordingly
* Added on click hook
* Added example on how to write it, how to use it, how it will look like can be reverted later
* Fix css error
* - Move addEventListener part to lib/static
- Remove comments
* Add documentation
* Remove examples
* Change syntax of the codetabs
* feat : #1084 Collapsus - The Collapsible Menu
* updated docs
* fixed prettier
* fix for category not auto-expanding upon navigating to a subcategory under it
* as requested by endiliey. Do not merge this commit.
* Update api-site-config.md
* Update guides-navigation.md
* Update SideNav.js
* Update main.css
* Update SideNav.js
* Delete subcategory1.md
* Delete subcategory2.md
* Update sidebars.json
* Fix broken build
Do not hardcode path in require to siteConfig
* Just require instead of loadConfig
* Actually use loadConfig
I think the test may be wrong too.
* refactor & nits
* jest mock to fix test
* fix test
* Allow other routes than /docs in the URL
siteConfig.js has a new mandatory field named *docsRoute* which default
value is 'docs' and that can be customized by the user.
This change will allow users who uses the library to host guides and
tutorials to customize their websites by assign 'docsRoute' values
like 'tutorials' or 'guides'.
Fixes#879
* Make "docsRoute" field optional
* Isolate docsRoute login in getDocsRoute function
* Rename docsRoute to docsUrl
* Run prettier
* Remove old folders
* fix: Restore docusaurus reference link
* fix: Add `docsUrl` param fallback. Refactor multiple function calls
* Fix linting errors
* Update description for docsUrl field
* Reduce redundant calls to getDocsUrl
* Replace a missed use case for `docsUrl` instead of the function call
* Move `getDocsUrl` out from `server/routing.js` to `server/utils.js`
**Why?**
Because `routing.js` is exporting all router RegEx's, and the
`getDocsUrl` suffices more as a util
* WiP: Align leading slashes and fix routing around `docsUrl`
Checklist:
- [x] Added `removeDuplicateLeadingSlashes` util to make sure there is only
one leading slash
- [-] Fix edge cases for routing:
- [x] `docsUrl: ''`
- [ ] `docsUrl: '/'`
- [ ] make it work with languages
- [ ] make it work with versioning
* Make leading slashes canonical cross routing and generated links
This ensures correct routing for customized `baseUrl` and `docsUrl`.
- Changed all routing functions to take `siteConfig` instead of
`siteConfig.baseUrl`
- Updated tests accordingly
* Alternative fallback for `docsUrl`
* rework/ fix implementation
* cleanup
* refactor and add docs for config props
* fix typo
* fix broken url
* add contributor list to each document
* handle case where there is no github repo
* Move to v1
* Revert "handle case where there is no github repo"
This reverts commit a76a887901.
* Revert "add contributor list to each document"
This reverts commit c0cc79f995.
* Add last updated by field
* -Include enableUpdateBy in the config
- Rename css class to be more general
* Fix lint
* Refactor :
- s/getGitlastupdated/getGitLastUpdatedTime
- refactor part in getGitLastUpdated[Time|By] that overlaps
- remove getAuthorInformation
* -Modify the display logic
-Refactor the utils, combine lastupdatedtime and lastupdatedby
-Replace the test
* Modify docs based on the display change
* Update docs for url and baseurl
For more clarity and to make relationship more clear
* Update support for Web App Manifest (#1046)
* misc: update nits
* misc: update nits
* Fix last updated time misleading, only show when file content change
or otherwise when it is first created
Fix#1015
* Fix prettier
* - Simplify regex
- Uses shelljs instead of cross-spawn
- Make logic clearer
* Add test when repositories is moved
* Use shell.exec mock
I initially try to mock the whole shelljs. But it returns error
shell.exec is not a function when i try to provide the mockResolvedValue
I think it is because of the inner code of shelljs who run a forEach to
require each of its method which make it a promise. I tried moving the
jest.mock inside beforeAll and also adding babel-dynamic-import but it did
not solve the problem. In the end, I decided to just mock shelljs.exec since
it is the only function used anyway