-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #118 from DataHighway-DHX/jeff/updateDocusaurus
Jeff/update docusaurus
- Loading branch information
Showing
217 changed files
with
1,194 additions
and
39,569 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
ALGOLIA_API_KEY= | ||
ALGOLIA_INDEX_NAME= |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,21 @@ | ||
.DS_Store | ||
# Dependencies | ||
/node_modules | ||
|
||
node_modules | ||
# Production | ||
/build | ||
|
||
lib/core/metadata.js | ||
lib/core/MetadataBlog.js | ||
# Generated files | ||
.docusaurus | ||
.cache-loader | ||
|
||
website/translated_docs | ||
website/build | ||
website/yarn.lock | ||
website/node_modules | ||
website/i18n/* | ||
# Misc | ||
.DS_Store | ||
.env | ||
.env.local | ||
.env.development.local | ||
.env.test.local | ||
.env.production.local | ||
|
||
output-markdown-toc.md | ||
output-html-toc.html | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,61 +1,41 @@ | ||
## Updating the Whitepaper | ||
|
||
1. Modifying styles | ||
|
||
It may be necessary to maintain duplicated styles that are in both ./style.css | ||
(used for generating PDF of whitepaper for download with md-to-pdf program) and | ||
website/static/css/custom.css (used for generating Whitepaper | ||
in the DataHighway Developer Hub). | ||
|
||
2. Updating diagrams | ||
1. Updating diagrams | ||
|
||
Most of the original diagrams that are included in the original v1.0.0 whitepaper were generated with Visual Paradigm, whose source file is .vpd format, and then converted to an image that was stored in the ./assets/images folder and embedded in the generated whitepaper. However some of the diagrams were modified by the MXC marketing team, and these were included in previous version [v1.1.0 whitepaper](https://github.com/DataHighway-DHX/documentation/releases). If you need to update any of the diagrams then please coordinate with the MXC marketing team. | ||
|
||
3. Run the following to create a new release in PDF format. Replace `v1.2.0` below with the desired version: | ||
|
||
``` | ||
nvm use v10.16.0 && | ||
npm install && | ||
node ./node_modules/.bin/md-to-pdf ./docs/whitepaper.md \ | ||
--config-file ./config.json \ | ||
./docs/whitepaper.pdf && | ||
mkdir -p ./versions/v1.2.0 && | ||
cp ./docs/whitepaper.pdf ./versions/v1.2.0/whitepaper.pdf | ||
``` | ||
|
||
Note: It is important to use Node.js v10.16.0 and version simonhaenisch/md-to-pdf#v2.7.0 otherwise you will get an error like `ListrError: Something went wrong`). If there are issues running the following, then run `npm init && | ||
npm install --save simonhaenisch/md-to-pdf#v2.7.0`. | ||
1. Install Node.js v16.3.0 | ||
|
||
Important: Check it generated the latest PDF to reflect the Markdown changes you made correctly in ./docs/whitepaper.pdf and the copy of it ./versions/v1.2.0/whitepaper.pdf. | ||
2. Start your development environment | ||
|
||
External links may reference the static location of the latest whitepaper in ./docs/whitepaper.pdf. A copy of each version is stored in a directory with the version name to make it easier for users to find older versions. | ||
```terminal | ||
npm install && \ | ||
npm install -g [email protected] && \ | ||
npm start | ||
``` | ||
|
||
Note: `headerIds` must be `true` in config.json otherwise TOC links do not work. | ||
2. Change into folder `./static/whitepapers/economic` folder and run the following to create a new release in PDF format. Replace `v1.2.0` or `v1_2_x` below with the desired version: | ||
|
||
4. Update the Whitepaper Table of Contents (TOC) | ||
```terminal | ||
cd ./static/whitepapers/economic | ||
Generate the TOC of the Whitepaper and save to a file in Markdown format using [markdown-toc](https://github.com/jonschlinkert/markdown-toc): | ||
mr-pdf --initialDocURLs="http://localhost:3000/docs/whitepaper" \ | ||
--contentSelector="article" \ | ||
--paginationSelector=".pagination-nav__item--next > a" \ | ||
--pdfMargin="50,50,50,50" \ | ||
--pdfFormat="A4" \ | ||
--outputPDFFilename="whitepaper_latest.pdf" | ||
```bash | ||
cd website && | ||
cd ./node_modules/markdown-toc/ && node cli.js --bullets "*" --no-firsth1 ../../../docs/whitepaper.md > ../../../output-markdown-toc.md && cd ../../../ | ||
cp ./whitepaper_latest.pdf ./whitepaper_v1_2_x.pdf | ||
``` | ||
|
||
Convert the Markdown version of the TOC into HTML using [pandoc](https://pandoc.org/) | ||
|
||
```bash | ||
brew install pandoc | ||
pandoc output-markdown-toc.md --from=gfm -t html -o output-html-toc.html | ||
``` | ||
|
||
Copy the contents of output-html-toc.html into ./docs/whitepaper.md as indicated here: | ||
Important: | ||
* Remove the first few including page 1 that generates text "untitled" and the Table of Contents pages, so the first page starts with "DataHighway's Whitepaper" | ||
* Check it generated the latest PDF to reflect the Markdown changes you made correctly in ./docs/whitepaper.mdx and the copy of it ./static/whitepapers/economic/v1.2.0/whitepaper.pdf. | ||
|
||
```bash | ||
<div class="pdf-only"> | ||
<span style="font-size: 1.5em; font-weight: 700;!important" class="pdf-only">Table of Contents</span> | ||
<!-- INSERT TOC BELOW HERE --> | ||
</div> | ||
``` | ||
External links may reference the static location of the latest whitepaper in ./whitepapers/economic/whitepaper_latest.pdf. A copy of each version is stored in a directory with the version name to make it easier for users to find older versions. | ||
|
||
### Troubleshooting | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module.exports = { | ||
presets: [require.resolve('@docusaurus/core/lib/babel/preset')], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
slug: welcome | ||
title: Welcome | ||
author: Jeff Stahlnecker | ||
author_title: DataHighway Contributor | ||
author_url: https://github.com/jeffstahlnecker | ||
author_image_url: https://avatars.githubusercontent.com/u/45363541?v=4 | ||
tags: [welcome] | ||
--- | ||
|
||
Welcome! We'll be posting some development updates here as the development continues. :) |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.