Skip to content

Commit 2ad2cef

Browse files
author
Brian McGee
committed
Merge pull request 'port docs' (#31) from feat/docs into main
Reviewed-on: https://git.numtide.com/numtide/treefmt/pulls/31
2 parents 404b0a9 + aa75d3d commit 2ad2cef

36 files changed

+3195
-87
lines changed

.github/CONTRIBUTING.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
By contributing to this project, you hereby acknowledge that you already read [Contributing](../docs/contributing.md)
2+
guideline, and you agree to the Developer Certificate of Origin (DCO). This document is a simple statement that you, as
3+
a contributor, have the legal right to submit the contribution.
4+
5+
See the [Developer Certificate of Origin](https://developercertificate.org/) file for details.

.github/dependabot.yml

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
schedule:
6+
interval: "weekly"

.github/settings.yml

+137
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
repository:
2+
# See https://developer.github.com/v3/repos/#edit for all available settings.
3+
4+
# The name of the repository. Changing this will rename the repository
5+
name: treefmt.go
6+
7+
# A short description of the repository that will show up on GitHub
8+
description: one CLI to format your repo
9+
10+
# A URL with more information about the repository
11+
homepage: "https://numtide.github.io/treefmt.go/"
12+
13+
# A comma-separated list of topics to set on the repository
14+
topics: "cli, formatter, unifies"
15+
16+
# Either `true` to make the repository private, or `false` to make it public.
17+
private: false
18+
19+
# Either `true` to enable issues for this repository, `false` to disable them.
20+
has_issues: true
21+
22+
# Either `true` to enable projects for this repository, or `false` to disable them.
23+
# If projects are disabled for the organization, passing `true` will cause an API error.
24+
has_projects: false
25+
26+
# Either `true` to enable the wiki for this repository, `false` to disable it.
27+
has_wiki: true
28+
29+
# Either `true` to enable downloads for this repository, `false` to disable them.
30+
has_downloads: false
31+
32+
# Updates the default branch for this repository.
33+
default_branch: main
34+
35+
# Either `true` to allow squash-merging pull requests, or `false` to prevent
36+
# squash-merging.
37+
allow_squash_merge: true
38+
39+
# Either `true` to allow merging pull requests with a merge commit, or `false`
40+
# to prevent merging pull requests with merge commits.
41+
allow_merge_commit: true
42+
43+
# Either `true` to allow rebase-merging pull requests, or `false` to prevent
44+
# rebase-merging.
45+
allow_rebase_merge: true
46+
47+
# Either `true` to enable automatic deletion of branches on merge, or `false` to disable
48+
delete_branch_on_merge: true
49+
50+
# Either `true` to enable automated security fixes, or `false` to disable
51+
# automated security fixes.
52+
enable_automated_security_fixes: true
53+
54+
# Either `true` to enable vulnerability alerts, or `false` to disable
55+
# vulnerability alerts.
56+
enable_vulnerability_alerts: true
57+
58+
# Labels: define labels for Issues and Pull Requests
59+
#
60+
labels:
61+
# NOTE: leave that up to the https://github.com/numtide/.github repo
62+
# - name: bug
63+
# color: CC0000
64+
# description: An issue with the system 🐛.
65+
66+
# - name: feature
67+
# # If including a `#`, make sure to wrap it with quotes!
68+
# color: '#336699'
69+
# description: New functionality.
70+
71+
# - name: Help Wanted
72+
# # Provide a new name to rename an existing label
73+
# new_name: first-timers-only
74+
75+
# Milestones: define milestones for Issues and Pull Requests
76+
milestones:
77+
# - title: milestone-title
78+
# description: milestone-description
79+
# # The state of the milestone. Either `open` or `closed`
80+
# state: open
81+
82+
# Collaborators: give specific users access to this repository.
83+
# See https://docs.github.com/en/rest/reference/repos#add-a-repository-collaborator for available options
84+
collaborators:
85+
- username: basile-henry
86+
# Note: `permission` is only valid on organization-owned repositories.
87+
# The permission to grant the collaborator. Can be one of:
88+
# * `pull` - can pull, but not push to or administer this repository.
89+
# * `push` - can pull and push, but not administer this repository.
90+
# * `admin` - can pull, push and administer this repository.
91+
# * `maintain` - Recommended for project managers who need to manage the repository without access to sensitive or destructive actions.
92+
# * `triage` - Recommended for contributors who need to proactively manage issues and pull requests without write access.
93+
permission: push
94+
95+
# See https://docs.github.com/en/rest/reference/teams#add-or-update-team-repository-permissions for available options
96+
teams:
97+
- name: network
98+
# The permission to grant the team. Can be one of:
99+
# * `pull` - can pull, but not push to or administer this repository.
100+
# * `push` - can pull and push, but not administer this repository.
101+
# * `admin` - can pull, push and administer this repository.
102+
# * `maintain` - Recommended for project managers who need to manage the repository without access to sensitive or destructive actions.
103+
# * `triage` - Recommended for contributors who need to proactively manage issues and pull requests without write access.
104+
permission: maintain
105+
106+
branches:
107+
- name: main
108+
# https://docs.github.com/en/rest/reference/repos#update-branch-protection
109+
# Branch Protection settings. Set to null to disable
110+
protection:
111+
# Required. Require at least one approving review on a pull request, before merging. Set to null to disable.
112+
required_pull_request_reviews:
113+
# # The number of approvals required. (1-6)
114+
# required_approving_review_count: 1
115+
# # Dismiss approved reviews automatically when a new commit is pushed.
116+
# dismiss_stale_reviews: true
117+
# # Blocks merge until code owners have reviewed.
118+
# require_code_owner_reviews: true
119+
# # Specify which users and teams can dismiss pull request reviews. Pass an empty dismissal_restrictions object to disable. User and team dismissal_restrictions are only available for organization-owned repositories. Omit this parameter for personal repositories.
120+
# dismissal_restrictions:
121+
# users: []
122+
# teams: []
123+
# Required. Require status checks to pass before merging. Set to null to disable
124+
required_status_checks:
125+
# Required. Require branches to be up to date before merging.
126+
strict: true
127+
# Required. The list of status checks to require in order to merge into this branch
128+
contexts: []
129+
# Required. Enforce all configured restrictions for administrators. Set to true to enforce required status checks for repository administrators. Set to null to disable.
130+
enforce_admins: false
131+
# Disabled for mergify to work
132+
required_linear_history: false
133+
# Required. Restrict who can push to this branch. Team and user restrictions are only available for organization-owned repositories. Set to null to disable.
134+
restrictions:
135+
apps: ["mergify"]
136+
users: []
137+
teams: []

.github/workflows/gh-pages.yml

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Build and deploy MkDocs to gh-pages for main branch
2+
name: gh-pages
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- staging
8+
- trying
9+
pull_request:
10+
workflow_dispatch:
11+
12+
permissions:
13+
contents: write
14+
15+
jobs:
16+
gh-pages:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v4
20+
- uses: cachix/install-nix-action@v25
21+
- uses: cachix/cachix-action@v14
22+
with:
23+
name: numtide
24+
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
25+
26+
- name: Build the docs
27+
id: build
28+
run: |
29+
nix build .#docs
30+
echo "result=$(readlink ./result)" >> $GITHUB_OUTPUT
31+
32+
- name: Deploy
33+
uses: peaceiris/actions-gh-pages@v3
34+
if: github.ref == 'refs/heads/main'
35+
with:
36+
github_token: ${{ secrets.GITHUB_TOKEN }}
37+
publish_dir: "${{ steps.build.outputs.result }}/"

.gitignore

+5
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,8 @@ repl-result-*
1010

1111
# devshell
1212
/.data
13+
14+
# docs
15+
node_modules
16+
docs/.vitepress/cache
17+
docs/.vitepress/dist

default.nix

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# This file provides backward compatibility to nix < 2.4 clients
2+
{system ? builtins.currentSystem}: let
3+
lock = builtins.fromJSON (builtins.readFile ./flake.lock);
4+
5+
inherit (lock.nodes.flake-compat.locked) owner repo rev narHash;
6+
7+
flake-compat = fetchTarball {
8+
url = "https://github.com/${owner}/${repo}/archive/${rev}.tar.gz";
9+
sha256 = narHash;
10+
};
11+
12+
flake = import flake-compat {
13+
inherit system;
14+
src = ./.;
15+
};
16+
in
17+
flake.defaultNix

docs/.vitepress/config.mts

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
import { defineConfig } from 'vitepress'
2+
3+
// https://vitepress.dev/reference/site-config
4+
export default defineConfig({
5+
title: "Treefmt",
6+
description: "one CLI to format your repo",
7+
8+
head: [
9+
['link', { rel: 'icon', href: '/logo.png' }],
10+
],
11+
12+
themeConfig: {
13+
14+
logo: '/logo.svg',
15+
16+
// https://vitepress.dev/reference/default-theme-config
17+
nav: [
18+
{ text: 'Home', link: '/' },
19+
{ text: 'Quick Start', link: '/quick-start' }
20+
],
21+
22+
sidebar: [
23+
{ text: 'Quick Start', link: '/quick-start' },
24+
{ text: 'Installation', link: '/installation' },
25+
{ text: 'Overview', link: '/overview' },
26+
{ text: 'Usage', link: '/usage' },
27+
{ text: 'Formatter Specification', link: '/formatter-spec' },
28+
{ text: 'Contributing', link: '/contributing' },
29+
{ text: 'FAQ', link: '/faq' },
30+
],
31+
32+
socialLinks: [
33+
{ icon: 'github', link: 'https://https://github.com/numtide/treefmt.go' }
34+
],
35+
36+
footer: {
37+
message: 'Released under the <a href="https://https://github.com/numtide/treefmt.go/src/branch/main/LICENSE.md">MIT License</a>.',
38+
copyright: "Copyright © 2024-present Treefmt Contributors"
39+
}
40+
}
41+
})

docs/.vitepress/theme/index.ts

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// https://vitepress.dev/guide/custom-theme
2+
import { h } from "vue";
3+
import type { Theme } from "vitepress";
4+
import DefaultTheme from "vitepress/theme";
5+
import "./style.css";
6+
7+
export default {
8+
extends: DefaultTheme,
9+
Layout: () => {
10+
return h(DefaultTheme.Layout, null, {
11+
// https://vitepress.dev/guide/extending-default-theme#layout-slots
12+
});
13+
},
14+
enhanceApp({ app, router, siteData }) {
15+
// ...
16+
},
17+
} satisfies Theme;

0 commit comments

Comments
 (0)