Skip to content
This repository has been archived by the owner on Nov 19, 2024. It is now read-only.

Commit

Permalink
replace Antora by docusaurus (#181)
Browse files Browse the repository at this point in the history
  • Loading branch information
mraszyk authored Jun 27, 2023
1 parent f1c006b commit b583572
Show file tree
Hide file tree
Showing 38 changed files with 5,689 additions and 5,612 deletions.
24 changes: 0 additions & 24 deletions .github/workflows/antora-branch.yml

This file was deleted.

19 changes: 19 additions & 0 deletions .github/workflows/check-cddl-candid.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: "check cddl and candid files"
on:
push:
jobs:
cddl-candid:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Check cddl files
run: |
docker run --rm -v $PWD/spec/_attachments:/workdir ghcr.io/anweiss/cddl-cli:0.9.1 compile-cddl --cddl /workdir/certificates.cddl
docker run --rm -v $PWD/spec/_attachments:/workdir ghcr.io/anweiss/cddl-cli:0.9.1 compile-cddl --cddl /workdir/requests.cddl
- name: Check candid files
run: |
curl -L https://github.com/dfinity/candid/releases/download/2023-05-26/didc-linux64 -o didc
chmod +x didc
./didc check spec/_attachments/http-gateway.did
./didc check spec/_attachments/ic.did
5 changes: 0 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,4 @@
.idea/

# Build and Test Output
result*
spec/index.html
spec/*.png
spec/.asciidoctor/
impl/.tasty-rerun-log
theories/code
19 changes: 0 additions & 19 deletions .netlify.sh

This file was deleted.

31 changes: 0 additions & 31 deletions ci-pr.nix

This file was deleted.

18 changes: 0 additions & 18 deletions ci.nix

This file was deleted.

72 changes: 0 additions & 72 deletions default.nix

This file was deleted.

3 changes: 3 additions & 0 deletions docusaurus/babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
presets: [require.resolve('@docusaurus/core/lib/babel/preset')],
};
1 change: 1 addition & 0 deletions docusaurus/docs/_attachments/certificates.cddl
1 change: 1 addition & 0 deletions docusaurus/docs/_attachments/http-gateway.did
1 change: 1 addition & 0 deletions docusaurus/docs/_attachments/ic.did
1 change: 1 addition & 0 deletions docusaurus/docs/_attachments/interface-spec-changelog.md
1 change: 1 addition & 0 deletions docusaurus/docs/_attachments/requests.cddl
1 change: 1 addition & 0 deletions docusaurus/docs/http-gateway-protocol-spec.md
1 change: 1 addition & 0 deletions docusaurus/docs/index.md
75 changes: 75 additions & 0 deletions docusaurus/docusaurus.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
// @ts-check
// Note: type annotations allow type checking and IDEs autocompletion

const customWebpack = require("./plugins/custom-webpack");
const simplePlantUML = require("@akebifiky/remark-simple-plantuml");
const math = require("remark-math");

const lightCodeTheme = require('prism-react-renderer/themes/github');
const darkCodeTheme = require('prism-react-renderer/themes/dracula');

/** @type {import('@docusaurus/types').Config} */
const config = {
title: 'The Internet Computer Interface Specification',

// Set the production url of your site here
url: 'https://ic-interface-spec.netlify.app',
// Set the /<baseUrl>/ pathname under which your site is served
// For GitHub pages deployment, it is often '/<projectName>/'
baseUrl: '/',

favicon: "/img/favicon-32x32.png",

plugins: [customWebpack],

// GitHub pages deployment config.
// If you aren't using GitHub pages, you don't need these.
organizationName: 'dfinity', // Usually your GitHub org/user name.
projectName: 'interface-spec', // Usually your repo name.

onBrokenLinks: 'throw',
onBrokenMarkdownLinks: 'warn',

// Even if you don't use internalization, you can use this field to set useful
// metadata like html lang. For example, if your site is Chinese, you may want
// to replace "en" with "zh-Hans".
i18n: {
defaultLocale: 'en',
locales: ['en'],
},

presets: [
[
'classic',
/** @type {import('@docusaurus/preset-classic').Options} */
({
docs: {
remarkPlugins: [math, simplePlantUML, require("remark-code-import")],
},
theme: {
customCss: require.resolve('./src/css/custom.css'),
},
}),
],
],

themeConfig:
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
({
navbar: {
items: [
{
href: 'https://github.com/dfinity/interface-spec',
label: 'GitHub',
position: 'right',
},
],
},
prism: {
theme: lightCodeTheme,
darkTheme: darkCodeTheme,
},
}),
};

module.exports = config;
46 changes: 46 additions & 0 deletions docusaurus/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"name": "html",
"version": "0.0.0",
"private": true,
"scripts": {
"docusaurus": "docusaurus",
"start": "docusaurus start",
"build": "docusaurus build",
"swizzle": "docusaurus swizzle",
"deploy": "docusaurus deploy",
"clear": "docusaurus clear",
"serve": "docusaurus serve",
"write-translations": "docusaurus write-translations",
"write-heading-ids": "docusaurus write-heading-ids"
},
"dependencies": {
"@akebifiky/remark-simple-plantuml": "^1.0.2",
"@docusaurus/core": "2.4.1",
"@docusaurus/preset-classic": "2.4.1",
"@mdx-js/react": "^1.6.22",
"clsx": "^1.2.1",
"prism-react-renderer": "^1.3.5",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"remark-math": "^3.0.1"
},
"devDependencies": {
"@docusaurus/module-type-aliases": "2.4.1",
"remark-code-import": "^0.4.0"
},
"browserslist": {
"production": [
">0.5%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"engines": {
"node": ">=16.14"
}
}
18 changes: 18 additions & 0 deletions docusaurus/plugins/custom-webpack.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/** @type {import('@docusaurus/types').PluginModule} */
const customWebpack = () => {
return {
name: `portal-docusaurus-plugin`,
configureWebpack() {
return {
node: {
__filename: true,
},
resolve: {
symlinks: false,
},
};
},
};
};

module.exports = customWebpack;
30 changes: 30 additions & 0 deletions docusaurus/src/css/custom.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/**
* Any CSS included here will be global. The classic template
* bundles Infima by default. Infima is a CSS framework designed to
* work well for content-centric websites.
*/

/* You can override the default Infima variables here. */
:root {
--ifm-color-primary: #2e8555;
--ifm-color-primary-dark: #29784c;
--ifm-color-primary-darker: #277148;
--ifm-color-primary-darkest: #205d3b;
--ifm-color-primary-light: #33925d;
--ifm-color-primary-lighter: #359962;
--ifm-color-primary-lightest: #3cad6e;
--ifm-code-font-size: 95%;
--docusaurus-highlighted-code-line-bg: rgba(0, 0, 0, 0.1);
}

/* For readability concerns, you should choose a lighter palette in dark mode. */
[data-theme='dark'] {
--ifm-color-primary: #25c2a0;
--ifm-color-primary-dark: #21af90;
--ifm-color-primary-darker: #1fa588;
--ifm-color-primary-darkest: #1a8870;
--ifm-color-primary-light: #29d5b0;
--ifm-color-primary-lighter: #32d8b4;
--ifm-color-primary-lightest: #4fddbf;
--docusaurus-highlighted-code-line-bg: rgba(0, 0, 0, 0.3);
}
Loading

0 comments on commit b583572

Please sign in to comment.