Skip to content

Commit ffe8b43

Browse files
authored
doc: add a documentation template (#25)
* Add the Zola website * Add documentation commands in Makefile
1 parent 55b1724 commit ffe8b43

File tree

265 files changed

+83375
-1
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

265 files changed

+83375
-1
lines changed
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Deploy GitHub Pages
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: read
11+
pages: write
12+
id-token: write
13+
14+
concurrency:
15+
group: 'pages'
16+
cancel-in-progress: false
17+
18+
jobs:
19+
build:
20+
runs-on: ubuntu-latest
21+
22+
env:
23+
ZOLA_VERSION: 0.19.2
24+
DOC_DIR: doc
25+
26+
steps:
27+
- name: Checkout code
28+
uses: actions/checkout@v4
29+
30+
- name: Setup Pages
31+
uses: actions/configure-pages@v4
32+
33+
- name: Setup Zola
34+
run: curl -s -L https://github.com/getzola/zola/releases/download/v${{ env.ZOLA_VERSION }}/zola-v${{ env.ZOLA_VERSION }}-x86_64-unknown-linux-gnu.tar.gz | sudo tar xvzf - -C /usr/local/bin
35+
shell: bash
36+
37+
- name: Build GitHub Pages
38+
run: zola --root ${{ env.DOC_DIR }} build
39+
40+
- name: Upload artifacts
41+
uses: actions/upload-pages-artifact@v3
42+
with:
43+
path: ./${{ env.DOC_DIR }}/public
44+
45+
deploy:
46+
runs-on: ubuntu-latest
47+
if: github.ref == 'refs/heads/main'
48+
needs: build
49+
50+
environment:
51+
name: github-pages
52+
url: ${{ steps.deployment.outputs.page_url }}
53+
54+
steps:
55+
- name: Deploy GitHub Pages
56+
id: deployment
57+
uses: actions/deploy-pages@v4

.github/workflows/rust-compiler-builder.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ on:
55
paths-ignore:
66
- '**/README.md'
77
- '**/LICENSE'
8+
- '**/doc/**'
89
schedule:
910
# https://crontab.guru/
1011
# At 12:00 AM

Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ RUST_INSTALL_DIR ?= install
99
RUST_DIST_FORMATS ?= xz
1010
RUST_USE_LLD ?= false
1111

12+
## ▸▸▸ Auxiliary commands ◂◂◂
1213
.PHONY: help
1314
help: ## Show this help
1415
@fgrep -h "## " $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//' | sed -e 's/## //'
@@ -18,6 +19,7 @@ clean: ## Remove download artifacts
1819
rm -rf rust
1920

2021
# Note: use Makefile.local for customization
22+
-include misc/make/doc.Makefile
2123
-include misc/make/offline.Makefile
2224
-include Makefile.local
2325

README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,20 @@ Builds the *Rust* compiler and [Tier 3 targets](https://doc.rust-lang.org/nightl
88

99
```sh
1010
$ make
11+
▸▸▸ Auxiliary commands ◂◂◂
1112
help: Show this help
12-
clean: Remove download artifacts
13+
clean: Remove downloaded artifacts
1314
▸▸▸ Download commands ◂◂◂
1415
download: Download Rust sources
1516
▸▸▸ Configure commands ◂◂◂
1617
configure: Configure Rust
1718
configure-with-llvm: Configure Rust and LLVM
1819
▸▸▸ Target Info commands ◂◂◂
1920
show-target-info: Show target info
21+
▸▸▸ Documentation commands ◂◂◂
22+
doc-build: Build the documentation site [env: DOC_DIR=]
23+
doc-serve: Serve the documentation site [env: DOC_PORT=]
24+
doc-clean: Remove generated artifacts [env: DOC_DIR=]
2025
▸▸▸ Offline commands ◂◂◂
2126
offline: Download prebuilt Rust binaries and cache them for offline use
2227
```

doc/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
public

doc/config.toml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# The URL the site will be built for
2+
base_url = "https://arttet.github.io/rust-compiler-builder/"
3+
title = "Rust Compiler Builder"
4+
description = "Documentation of Rust Compiler Builder"
5+
6+
# The site theme to use.
7+
theme = "adidoks"
8+
9+
# The default language; used in feeds and search index
10+
default_language = "en"
11+
12+
# Whether to automatically compile all Sass files in the sass directory
13+
compile_sass = true
14+
15+
# When set to "true", the generated HTML files are minified.
16+
minify_html = true
17+
18+
# Whether to build a search index to be used later on by a JavaScript library
19+
build_search_index = false
20+
21+
[markdown]
22+
# Whether to do syntax highlighting
23+
# Theme can be customised by setting the `highlight_theme` variable to a theme supported by Zola
24+
highlight_code = true
25+
26+
[extra]
27+
title_addition = "Documentation of Rust Compiler Builder"
28+
timezone = "Asia/Dubai"
29+
30+
[extra.open]
31+
enable = false
32+
image = "static/icons/favicon.png"
33+
34+
[[extra.menu.social]]
35+
name = "GitHub"
36+
pre = '<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-github"><path d="M9 19c-5 1.5-5-2.5-7-3m14 6v-3.87a3.37 3.37 0 0 0-.94-2.61c3.14-.35 6.44-1.54 6.44-7A5.44 5.44 0 0 0 20 4.77 5.07 5.07 0 0 0 19.91 1S18.73.65 16 2.48a13.38 13.38 0 0 0-7 0C6.27.65 5.09 1 5.09 1A5.07 5.07 0 0 0 5 4.77a5.44 5.44 0 0 0-1.5 3.78c0 5.42 3.3 6.61 6.44 7A3.37 3.37 0 0 0 9 18.13V22"></path></svg>'
37+
url = "https://github.com/arttet/rust-compiler-builder"
38+
post = "v0.1.0"
39+
weight = 20
40+
41+
[extra.footer]
42+
info = '© 2024 <a href="https://github.com/arttet">Artyom Tetyukhin</a>'

doc/content/_index.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
+++
2+
title = "Rust Compiler Builder"
3+
4+
5+
# The homepage contents
6+
[extra]
7+
lead = '<b>Rust Compiler Builder</b> is a configuration tool to build the <a href="https://github.com/rust-lang/rust">Rust compiler</a> and tier 3 <a href="https://doc.rust-lang.org/nightly/rustc/platform-support.html">Rust targets</a>.'
8+
url = "/docs/getting-started/introduction/"
9+
url_button = "Get started"
10+
repo_version = ""
11+
repo_license = "MIT License"
12+
repo_url = "https://github.com/arttet/rust-compiler-builder"
13+
14+
# Menu items
15+
[[extra.menu.main]]
16+
name = "Documentation"
17+
section = "docs"
18+
url = "/docs/getting-started/introduction/"
19+
weight = 10
20+
21+
[[extra.list]]
22+
title = "Integrated with GitHub CI/CD"
23+
content = 'Easily add your tier 3 <a href="https://doc.rust-lang.org/nightly/rustc/platform-support.html">Rust targets</a> to your CI/CD pipeline and build them whenever you want.'
24+
25+
[[extra.list]]
26+
title = "Customizable ⚡️"
27+
content = 'Easily customizable environment for building the <a href="https://github.com/rust-lang/rust">Rust compiler</a> with <a href="https://github.com/rust-lang/llvm-project">LLVM</a> from different channels.'
28+
29+
[[extra.list]]
30+
title = "Offline Mode"
31+
content = 'Easily prepare the <a href="https://github.com/rust-lang/rust">Rust compiler</a> for offline mode without needing constant access to the Internet.'
32+
33+
+++

doc/content/docs/_index.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
+++
2+
title = "Documentation"
3+
sort_by = "weight"
4+
weight = 1
5+
template = "docs/section.html"
6+
+++
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
+++
2+
title = "Getting Started"
3+
template = "docs/section.html"
4+
sort_by = "weight"
5+
weight = 1
6+
draft = false
7+
+++
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
+++
2+
title = "Introduction"
3+
draft = false
4+
weight = 10
5+
sort_by = "weight"
6+
template = "docs/page.html"
7+
8+
[extra]
9+
lead = ''
10+
toc = true
11+
top = false
12+
+++
13+
14+
## Quick Start
15+
16+
### Documentation in Progress
17+
18+
Thank you for visiting this website. Please note that the documentation is currently under development. I am actively working on providing comprehensive and detailed information about the configuration files and scripts included in this repository.
19+
20+
In the meantime, feel free to explore the repository and reach out if you have any questions. Your patience and understanding are greatly appreciated.
21+
22+
Stay tuned for updates!

0 commit comments

Comments
 (0)