This repository was archived by the owner on Jun 29, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 93
gh-pages publishing #222
Closed
Closed
gh-pages publishing #222
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
b602c30
www: add vuepress for publishing
rvagg 440129f
www: add gh-pages build & publish workflow
rvagg 0afb149
fixup! www: add gh-pages build & publish workflow
rvagg 40b7558
www: deploy on specs.ipld.io
rvagg c0c0bb5
www: (temp) rewrite schema ../ urls to absolute
rvagg File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,31 @@ | ||
name: gh-pages | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v1 | ||
with: | ||
fetch-depth: 1 | ||
|
||
- name: Build with Node.js | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: '12.x' | ||
- run: npm install | ||
- run: npm run build | ||
|
||
- name: GitHub Pages action | ||
uses: peaceiris/[email protected] | ||
env: | ||
ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }} | ||
PUBLISH_BRANCH: gh-pages | ||
PUBLISH_DIR: ./html/.vuepress/dist/ |
This file contains hidden or 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 @@ | ||
node_modules/ | ||
html/ |
This file contains hidden or 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 @@ | ||
--- | ||
editLink: false | ||
--- | ||
|
||
# IPLD Specifications | ||
|
||
Specifications for the Inter-planetary Linked Data (IPLD) project: | ||
|
||
* **[IPLD Schemas](./schemas/)** | ||
|
||
See more or contribute on [GitHub](https://github.com/ipld/specs/). |
This file contains hidden or 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,55 @@ | ||
require('./highlight') | ||
|
||
function linkfix (md) { | ||
const defaultRender = md.renderer.rules.link_open | ||
|
||
md.renderer.rules.link_open = function (tokens, idx, options, env, self) { | ||
const hrefIndex = tokens[idx].attrIndex('href'); | ||
if (hrefIndex > -1) { | ||
const href = tokens[idx].attrs[hrefIndex][1] | ||
if (/\.(ipldsch|json)$/.test(href)) { | ||
tokens[idx].attrs[hrefIndex][1] = `${href}.md` | ||
} | ||
} | ||
|
||
return defaultRender(tokens, idx, options, env, self) | ||
} | ||
} | ||
|
||
module.exports = { | ||
title: 'IPLD Specifications', | ||
description: 'Specifications for the Inter-planetary Linked Data project', | ||
base: '/', | ||
themeConfig: { | ||
repo: 'ipld/specs', | ||
editLinks: true, | ||
editLinkText: 'Edit this page on GitHub', | ||
lastUpdated: 'Last Updated', | ||
smoothScroll: true, | ||
nav: [ | ||
{ text: 'Home', link: '/' }, | ||
{ text: 'IPLD Schemas', link: '/schemas/' } | ||
], | ||
sidebar: { | ||
'/schemas/': [{ | ||
title: 'IPLD Schemas', | ||
collapsable: false, | ||
sidebarDepth: 2, | ||
children: [ | ||
['goals', 'Goals'], | ||
['feature-summary', 'Feature Summary'], | ||
['introduction', 'Introduction'], | ||
['authoring-guide', 'Authoring Guide'], | ||
'links', | ||
'schema-kinds', | ||
['representations', 'Representations'], | ||
['advanced-layouts', 'Advanced Layouts'] | ||
] | ||
}] | ||
} | ||
}, | ||
extendMarkdown: md => { | ||
// use more markdown-it plugins! | ||
md.use(linkfix) | ||
} | ||
} |
This file contains hidden or 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,36 @@ | ||
// this require is awkward but technically the proper way to find the 'prismjs' | ||
// that's used by vuepress -> @vuepress/markdown -> prismjs | ||
const prism = require( | ||
require.resolve('prismjs', | ||
require.resolve('@vuepress/markdown', | ||
require.resolve('vuepress')))) | ||
|
||
prism.languages.ipldsch = { | ||
typedef: { | ||
pattern: /^[ \t]*(?:type|advanced)[ \t][A-Z](_?[A-Za-z0-9])*\b/m, | ||
inside: { | ||
keyword: /^[ \t]*(type|advanced)/m, | ||
'class-name': /[\w]+$/ | ||
} | ||
}, | ||
keyword: /\b(?:bool|int|float|string|bytes|null|nullable|optional)\b/, | ||
builtin: /\b(struct|union|enum)(?=[ \t]*\{)\b/, | ||
representation: { | ||
pattern: /^}[ \t]representation\b/m, | ||
inside: { | ||
builtin: /representation/ | ||
} | ||
}, | ||
operator: /=/, | ||
number: /\b-?\d+\.?\d*(?:e[+-]?\d+)?\b/i, | ||
punctuation: /[(){}:[\]\|&]/, | ||
string: { | ||
pattern: /(")(?:\\[\s\S]|(?!\1)[^\\])*\1/, | ||
greedy: true | ||
}, | ||
comment: { | ||
pattern: /(^|[^"])#.*/, | ||
lookbehind: true, | ||
greedy: true | ||
} | ||
} |
This file contains hidden or 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 @@ | ||
div[class~="language-ipldsch"]::before { | ||
content: "ipld schema"; | ||
} |
This file contains hidden or 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 @@ | ||
specs.ipld.io |
This file contains hidden or 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,14 @@ | ||
{ | ||
"scripts": { | ||
"prepare:base": "rm -rf html && mkdir html && cp -a .vuepress/ html/.vuepress/ && mv html/.vuepress/README.md html/", | ||
"prepare:content": "cp -a schemas/ html/schemas/", | ||
"prepare:ipldsch": "cd html && find . -name \\*.ipldsch -exec sh -c \"echo '---\\neditLink: false\\n---\\n\\n\\`\\`\\`ipldsch' > {}.md && cat {} >> {}.md && echo '\\`\\`\\`' >> {}.md\" \\;", | ||
"prepare:json": "find html/ -name \\*.json -exec sh -c \"echo '---\\neditLink: false\\n---\\n\\n\\`\\`\\`json' > {}.md && cat {} >> {}.md && echo '\\`\\`\\`' >> {}.md\" \\;", | ||
"build:vue": "vuepress build html --no-cache", | ||
"build": "set -e; for t in prepare:base prepare:content prepare:ipldsch prepare:json build:vue; do npm run $t; done", | ||
"serve": "echo '\n\n\u001b[1mView IPLD Specs @ http://localhost:1337/\u001b[22m\n\n'; npx st --dir html/.vuepress/dist --no-cache --index index.html" | ||
}, | ||
"dependencies": { | ||
"vuepress": "^1.2.0" | ||
} | ||
} |
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.