Commit graph

28 commits

Author SHA1 Message Date
Fienny Angelina
a1d36be61c fix: make referenced links work with code block tabs (#1249)
* 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
2019-02-26 08:56:30 -08:00
Marvin Chin
b2f3642fc6 fix: use clean url for og:url when cleanUrl is true (#1242) 2019-02-21 12:24:31 -08:00
Yangshun Tay
1fb1a92293
fix: change sidebar chevron icon to use svg (#1211) 2019-01-28 22:03:11 -08:00
Joel Marcey
fdd5117300
Add copyright header to CodeTabsMarkdownBlock.js 2019-01-25 13:42:47 -08:00
Yangshun Tay
dcd3361413 misc: update docs for new features 2019-01-23 23:20:11 -08:00
Fienny Angelina
5ce85e5b5e feat: code block tab (#1063)
* 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
2019-01-23 21:48:01 -08:00
Marvin Chin
4ce7ae2c98 fix: wrong padding for single row mobile nav (#1191) 2019-01-23 21:42:16 -08:00
tsmrachel
d5fd15ecbe feat: collapsible categories (#1128)
* 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
2019-01-23 14:13:27 -08:00
Marvin Chin
4dcd6840c3 fix: missing default value for grid block content objects (#1186) 2019-01-16 00:31:27 -08:00
Endilie Yacop Sucipto
f12549424e
fix: edit url should support versioned subdirectories (#1154)
fix: edit url should support versioned subdirectories
2018-12-11 11:22:23 +08:00
Dom Corvasce
61078e38a9 feat: Allow modifying docs url prefix (#914)
* 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
2018-11-28 15:34:16 +08:00
maxaggedon
c6f3f0958d feat: customizable search placeholder (#1126)
* feat: customizable search placeholder

* prettier
2018-11-23 14:27:59 -08:00
maxaggedon
2df14feafd feat: use 'sidebar_label' instead of 'title' in prev/next buttons (#1122)
* feat: use 'sidebar_label' instead of 'title' in prev/next buttons

* docs: update 'sidebar_label' description
2018-11-22 18:36:05 +08:00
Endilie Yacop Sucipto
46404461b8
fix: translated pages missing left TOC (#1119) 2018-11-20 16:36:56 +08:00
Shriram Balaji
91c5e5e444 fix: warn unsupported languages by prismjs (#1107)
* Logged unsupported languages instead of stacktrace error. Added some lang aliases

* Modify language highlight color
2018-11-12 18:39:33 +08:00
Yangshun Tay
8bcb5d3365 chore: revert full-width nav changes 2018-10-31 22:35:41 -07:00
Hugues Tennier
e788dc4122 fix: previous / next page buttons label (#1079) 2018-10-31 09:47:55 +08:00
sinodko
06e243a77f fix: render proper HTML instead of raw markdown in og:description(#1054) 2018-10-24 09:07:46 +08:00
Fienny Angelina
8cf9afe4ac feat: add last contributor to each document (#980)
* 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
2018-10-18 00:59:16 -07:00
Tirth Bodawala
4a7e1ea189 Update support for Web App Manifest (#1046) 2018-10-17 10:21:10 -07:00
Yangshun Tay
b577f60d4a
fix: improve last updated time feature (#1036) 2018-10-14 15:05:00 -07:00
Fienny Angelina
a39677c202 fix: exclude file movements for last updated time (#1023)
* 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
2018-10-14 14:09:39 -07:00
Kevin Kipp
e880756614 feat: add keyboard shortcut to focus search (#1028)
* feat: add keyboard shortcut to focus search

* refactor: use const instead of let

* refactor: check target and bail if not body
2018-10-11 22:50:12 -07:00
Yangshun Tay
fe500dea82
fix: change subcategory format (#1026)
* fix: change subcategory format

* Fix sidebars

* Refactor

* Fix implementation

* Change format
2018-10-10 08:33:20 -07:00
Will Brock
954456088c feat: sub-categories in sidebar.json (#892)
* Add ability to specify sub categories in sidebar.json

* move v1 files to correct place

* refactor implementation

* refactor naming for implementation clarity
2018-10-08 16:09:29 +08:00
Erik Sultanaliev
aae5c4dc85 fix: highlightjs custom highlighting function(#1016)
* Added line for syntax definition #960

* chore: nits & fix for v2 as well
2018-10-05 15:59:24 +08:00
Marvin Heilemann
8568a96e65 Added option for client to include there own remarkable config (#974)
* Added option for client to include there own remarkable config

* Better use merge here

* Added lodash ...

* Change use of lodash to deepmerge and added description to api site

* markdownConfig -> markdownOptions

* Update api-site-config.md

* remove 1.4 docs change

 since it is unrelated (the feature will only be available in next release)

* Run prettier
2018-09-20 15:00:59 +08:00
Yangshun Tay
f2927a9fc4
Move Docusaurus 1 files into directory (#966)
* Move Docusaurus 1 into v1 directory

* Update Circle CI commands for new v1 dir

* Remove OC

* Fix tests
2018-09-18 00:58:07 +08:00