Skip to content

Commit

Permalink
Merge branch 'main' into refactor/split-up-get-started
Browse files Browse the repository at this point in the history
  • Loading branch information
pdaoust committed Mar 11, 2024
2 parents 1959fd4 + c8f06bf commit de96bda
Show file tree
Hide file tree
Showing 36 changed files with 1,857 additions and 4,411 deletions.
26 changes: 26 additions & 0 deletions .cspell/custom-words.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Words that are neither common nor directly related to Holochain but appear in
# Dev Portal content
agent-centricity
Anwaar
buildinputs
builtins
Burmeister
Cachix
CRDT
d'Aoust
fixt
gnused
IPFS
NixOS
nixpkgs
pkgs
QUIC
rustc
rustflags
rustup
subl
Tauri
Ulhaq
Wahlstrom
WebRTC
workdir
17 changes: 17 additions & 0 deletions .cspell/holochain-words.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Words that are distinctly Holochainy
DeepKey
dnas
DPKI
hApp
Holo
Holo's
Holochain
Holochain's
Holonix
sharded
Tryorama
webhapp
zome
zome's
zomes
zomes'
19 changes: 19 additions & 0 deletions .cspell/template-words.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Words found in our template code
brower
coreconcepts
elif
endfor
endlayoutblock
endlink
endmacro
endrenderlayoutblock
gtag
layoutblock
MSIE
newblock
pagefind
rocketship
renderlayoutblock
srcset
storysequence
surpress
24 changes: 24 additions & 0 deletions .cspell/words-that-should-exist.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Common words that should appear in the default dictionaries but don't
affordance
affordances
automations
birthdate
counterparties
counterparties'
counterparty
counterparty's
filesystem
filesystems
howto
howtos
interoperating
permissioned
permissivity
runtimes
sandboxed
spacebar
todo
todos
unforgeable
uninstallation
unvalidated
19 changes: 19 additions & 0 deletions .github/workflows/spellcheck.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: 'Check spelling'
on: # rebuild any PRs and main branch changes
pull_request:
push:

jobs:
spellcheck: # run the action
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: 'Get dictionaries'
run: |
npm install @cspell/dict-lorem-ipsum
npm install @cspell/dict-rust
- uses: streetsidesoftware/cspell-action@v5
with:
root: 'src'
files: '**/*.{json5,njk,md}'
incremental_files_only: false
16 changes: 12 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
This repo builds the documentation for developer.holochain.org generated by 11ty (https://www.11ty.dev/).

## A note about browsers
Other than a warning to the user (see `unsupported-brower-warning.njk` if you care) ___no___ effort has been made to accomadate non-Evergreen browsers, which is mostly to say Internet Explorer of any version. There isn't a lot of js in the rendered site, but what there is won't work, and newer CSS features are used as well.
Other than a warning to the user (see `unsupported-brower-warning.njk` if you care) ___no___ effort has been made to accommodate non-Evergreen browsers, which is mostly to say Internet Explorer of any version. There isn't a lot of js in the rendered site, but what there is won't work, and newer CSS features are used as well.

## What the heck is 11ty (an extremely quick intro)
11ty, or Eleventy, is a NodeJS based static website generator. It supports a bunch of template types,
including markdown and nunjucks (https://mozilla.github.io/nunjucks/) which we use here. By default any
template file in the input directory will generate an html file in the generated site. It also supports
includes and data generated content. It is extremely configuarable and as such the docs (https://www.11ty.dev/docs/)
includes and data generated content. It is extremely configurable and as such the docs (https://www.11ty.dev/docs/)
can be a handful, but they are quite good and are worth a look.

## How are we using 11ty
Expand Down Expand Up @@ -57,7 +57,7 @@ There are two reasons for this:
The tag will be added to the `<code>` element as a `language-<tag>` CSS class, along with a `hljs` tag. The surrounding `<pre>` element will also get a `hljs-container` class. We're using the `atom-one-light` theme that ships with highlight.js.

## Using Markdown Here
We are using a mixture of markdown and nunjucks as the main page templates. For documentation pages (as opposed to more blingy pages like the home page) md is prefered.
We are using a mixture of markdown and nunjucks as the main page templates. For documentation pages (as opposed to more blingy pages like the home page) md is preferred.

By default 11ty uses the [markdown-it](https://github.com/markdown-it/markdown-it) parser and we stuck with that.
Additionally the following `markdown-it` plugins have been added:
Expand Down Expand Up @@ -87,6 +87,11 @@ Additionally the following `markdown-it` plugins have been added:
Please note: The closing `:::` is required. Also if you need to nest containers then the outer container gets an additional `:`.
Each container type needs to be configured in `markdown-it-config.js` for examples and to add more. This one provides a lot of flexibility.

## Site search and indexing
The site uses the [Pagefind](https://pagefind.app/) library to index the contents of the site and to find search results upon request.
The documentation is quite good. One thing to note; pages are indexed based on the inclusion of the `data-pagefind-body`
attribute on a page. It is included on all of the main pages (all but the Design System). If you need to remove some or all of a page
from indexing you can use the `data-pagefind-ignore` attribute. See (https://pagefind.app/docs/indexing/) for details.

## Setup for Dev
- `npm install`
Expand All @@ -99,9 +104,12 @@ Additionally the following `markdown-it` plugins have been added:
- Cleans `_site` dir
- Builds, [autoprefixes](https://github.com/postcss/autoprefixer) and minifies the SCSS
- Bundles the JS modules
- Builds the Typescript to JS
- Minifies the JS with Terser
- Saves the module to `_site/scripts/` dir
- Builds 11ty with links to the bundled JS and minified CSS
- `clean`: Cleans out the `_site` dir
- `build:search-index`: builds the index files for the search function. This is called as pat of the build process, but if you want the search to work during local dev then you need to run this once, or you can just run `build` before you start the `dev` script.
- `update-browserlist`: Updates the browserlist that autoprefixer uses detirmine what vendor prefixes are needed for your specified browser set. Run once in a while.
- `update-browserlist`: Updates the browserlist that autoprefixer uses determine what vendor prefixes are needed for your specified browser set. Run once in a while.


22 changes: 22 additions & 0 deletions cspell.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"import": ["@cspell/dict-lorem-ipsum/cspell-ext.json", "@cspell/dict-rust/cspell-ext.json"],
"dictionaries": ["holochain", "words-that-should-exist", "custom", "template", "html", "css", "softwareTerms", "lorem-ipsum", "rust"],
"dictionaryDefinitions": [
{
"name": "holochain",
"path": "./.cspell/holochain-words.txt"
},
{
"name": "words-that-should-exist",
"path": "./.cspell/words-that-should-exist.txt"
},
{
"name": "custom",
"path": "./.cspell/custom-words.txt"
},
{
"name": "template",
"path": "./.cspell/template-words.txt"
}
]
}
11 changes: 8 additions & 3 deletions netlify.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
from = "/resources/happ-bundle/"
to = "/redirect-to-redux-site.html#!docs/resources/happ-bundle/"
# There will eventually be a new hApp bundle format that will get documented,
# and I intend to put it under `/references`.
# and I intend to put it under `/resources`.
status = 302

# Some of the core concepts' titles and URLs have changed,
Expand Down Expand Up @@ -71,6 +71,11 @@
to = "/concepts/8_calls_capabilities/"
status = 301

[[redirects]]
from = "/references/*"
to = "/resources/:splat"
status = 301

# Once upon a time, we had a landing page and all the actual docs were in /docs.
[[redirects]]
from = "/docs/*"
Expand Down Expand Up @@ -101,10 +106,10 @@
to = "/get-started/"
status = 301

# Glossary has been moved to the references path.
# Glossary has been moved to the resources path.
[[redirects]]
from = "/glossary/"
to = "/references/glossary/"
to = "/resources/glossary/"
status = 301

# The front page for the core concepts has been removed.
Expand Down
Loading

0 comments on commit de96bda

Please sign in to comment.