Skip to content

Commit

Permalink
Merge pull request #491 from alejandrohdezma/docs/docusaurus
Browse files Browse the repository at this point in the history
Build website with Docusarurus
  • Loading branch information
alejandrohdezma authored Mar 20, 2023
2 parents a4b6609 + 3d57e69 commit 777bb35
Show file tree
Hide file tree
Showing 31 changed files with 7,915 additions and 142 deletions.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,11 @@ jobs:
- 17
steps:
- name: Checkout project
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
with:
ref: ${{ github.head_ref }}

- uses: actions/setup-java@de1bb2b0c5634f0fc4438d7aa9944e68f9bf86cc # v3.6.0
- uses: actions/setup-java@3f07048e3d294f56e9b90ac5ea2c6f74e9ad0f98 # v3.10.0
with:
distribution: "liberica"
java-version: ${{ matrix.jdk }}
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout project
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
with:
fetch-depth: 0

- name: Check latest tag follows semantic versioning
if: github.event_name == 'push'
uses: alejandrohdezma/actions/check-semver-tag@v1

- uses: actions/setup-java@de1bb2b0c5634f0fc4438d7aa9944e68f9bf86cc # v3.6.0
- uses: actions/setup-java@3f07048e3d294f56e9b90ac5ea2c6f74e9ad0f98 # v3.10.0
with:
distribution: "liberica"
java-version: "11"
Expand All @@ -59,13 +59,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout project
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
with:
fetch-depth: 0
ref: main
token: ${{ secrets.ADMIN_GITHUB_TOKEN }}

- uses: actions/setup-java@de1bb2b0c5634f0fc4438d7aa9944e68f9bf86cc # v3.6.0
- uses: actions/setup-java@3f07048e3d294f56e9b90ac5ea2c6f74e9ad0f98 # v3.10.0
with:
distribution: "liberica"
java-version: "17"
Expand Down
13 changes: 5 additions & 8 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,21 @@ ThisBuild / pluginCrossBuild / sbtVersion := "1.2.8"
ThisBuild / Test / parallelExecution := false

addCommandAlias("ci-test", "fix --check; mdoc; test; publishLocal; scripted")
addCommandAlias("ci-docs", "github; mdoc; headerCreateAll; publishToGitHubPages")
addCommandAlias("ci-docs", "github; mdoc; headerCreateAll; docusaurusPublishGhpages")
addCommandAlias("ci-publish", "github; ci-release")

val `sbt-mdoc` = "org.scalameta" % "sbt-mdoc" % "[2.0,)" % Provided // scala-steward:off

val `sbt-header` = "de.heikoseeberger" % "sbt-header" % "[5.6.0,)" % Provided // scala-steward:off

lazy val documentation = project
.enablePlugins(MdocPlugin)
.settings(mdocOut := file("."))
lazy val documentation = project.enablePlugins(MdocPlugin)

lazy val site = project
.enablePlugins(MdocPlugin)
lazy val website = project
.enablePlugins(MdocPlugin, DocusaurusPlugin)
.settings(mdocIn := baseDirectory.value / "docs")
.settings(mdocOut := (Compile / target).value / "mdoc")
.settings(watchTriggers += mdocIn.value.toGlob / "*.md")
.settings(mdocVariables += "EXCLUDED" -> excludedContributors.value.mkString("- ", "\n- ", ""))
.enablePlugins(GitHubPagesPlugin)
.settings(gitHubPagesSiteDir := mdocOut.value)

lazy val `sbt-github` = module
.enablePlugins(SbtPlugin)
Expand Down
2 changes: 2 additions & 0 deletions project/dependencies.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ Compile / unmanagedSourceDirectories ++= Seq(
(ThisBuild / baseDirectory).value.getParentFile / "modules" / "sbt-github-header" / "src" / "main" / "scala",
(ThisBuild / baseDirectory).value.getParentFile / "modules" / "sbt-github" / "src" / "main" / "scala"
)

libraryDependencies += "org.typelevel" %% "jawn-parser" % "1.4.0"
3 changes: 1 addition & 2 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.10.4")
addSbtPlugin("com.alejandrohdezma" % "sbt-fix" % "0.7.0")
addSbtPlugin("com.alejandrohdezma" % "sbt-ci" % "2.12.0")
addSbtPlugin("com.alejandrohdezma" % "sbt-ci" % "2.13.0")
addSbtPlugin("com.alejandrohdezma" % "sbt-scalafmt-defaults" % "0.8.0")
addSbtPlugin("com.alejandrohdezma" % "sbt-scalafix-defaults" % "0.10.0")
addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.5.11")
addSbtPlugin("de.heikoseeberger" % "sbt-header" % "5.9.0")
addSbtPlugin("io.github.davidgregory084" % "sbt-tpolecat" % "0.4.2")
addSbtPlugin("org.scalameta" % "sbt-mdoc" % "2.3.7")
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.5.0")
addSbtPlugin("io.kevinlee" % "sbt-github-pages" % "0.12.0")
addSbtPlugin("com.alejandrohdezma" % "sbt-modules" % "0.2.0")
29 changes: 0 additions & 29 deletions site/docs/_coverpage.md

This file was deleted.

20 changes: 0 additions & 20 deletions site/docs/_media/octocat.svg

This file was deleted.

8 changes: 0 additions & 8 deletions site/docs/_sidebar.md

This file was deleted.

65 changes: 0 additions & 65 deletions site/docs/index.html

This file was deleted.

20 changes: 20 additions & 0 deletions website/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Dependencies
/node_modules

# Production
/build

# Generated files
.docusaurus
.cache-loader

# Misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
---
sidebar_position: 1
---

# Getting Started

## Installation
Expand Down Expand Up @@ -45,5 +49,5 @@ sbt "github; ci-release"

There are some integrations available also:

- If you use [mdoc](https://scalameta.org/mdoc/) there's also available an [mdoc integration module](sbt-mdoc.md)
- If you use [sbt-header](https://github.com/sbt/sbt-header) there's also available an [sbt-header integration module](sbt-header.md)
- If you use [mdoc](https://scalameta.org/mdoc/) there's also available an [mdoc integration module](integrations/sbt-mdoc.md)
- If you use [sbt-header](https://github.com/sbt/sbt-header) there's also available an [sbt-header integration module](integrations/sbt-header.md)
File renamed without changes.
3 changes: 3 additions & 0 deletions website/docs/integrations/_category_.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
label: Integrations
collapsible: true
collapsed: false
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ If you use [sbt-header](https://github.com/sbt/sbt-header) for creating/updating
addSbtPlugin("com.alejandrohdezma" % "sbt-github-header" % "@VERSION@")
```

!> Important! So we don't force a version of sbt-header, it is requested as a ["Provided"](https://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html) dependency so you'll need to provide your own version of [sbt-header](https://github.com/sbt/sbt-header).
:::note

So we don't force a version of sbt-header, it is requested as a ["Provided"](https://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html) dependency so you'll need to provide your own version of [sbt-header](https://github.com/sbt/sbt-header).

:::

## What does this integration do?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ If you use [mdoc](https://scalameta.org/mdoc/) for creating your documentation y
addSbtPlugin("com.alejandrohdezma" % "sbt-github-mdoc" % "@VERSION@")
```

!> Important! So we don't force a version of mdoc, it is requested as a ["Provided"](https://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html) dependency so you'll need to provide your own version of mdoc following [its own tutorial](https://scalameta.org/mdoc/docs/installation.html).
:::note

So we don't force a version of mdoc, it is requested as a ["Provided"](https://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html) dependency so you'll need to provide your own version of mdoc following [its own tutorial](https://scalameta.org/mdoc/docs/installation.html).

:::

The plugin provides the following `mdocVariables`:

Expand Down
File renamed without changes.
74 changes: 74 additions & 0 deletions website/docusaurus.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
/** @type {import('@docusaurus/types').Config} */
const config = {
title: 'sbt-github',
tagline: 'SBT plugin to read several settings from Github',
favicon: 'img/favicon.ico',

url: 'https://alejandrohdezma.github.io',
baseUrl: '/sbt-github/',

organizationName: 'alejandrohdezma',
projectName: 'sbt-github',

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

i18n: {
defaultLocale: 'en',
locales: ['en'],
},

presets: [
[
'classic',
/** @type {import('@docusaurus/preset-classic').Options} */
({
docs: {
path: 'target/mdoc/',
editUrl: params => 'https://github.com/alejandrohdezma/sbt-github/edit/main/site/docs/' + params.docPath,
},
theme: {
customCss: require.resolve('./src/css/custom.css'),
},
}),
],
],

themeConfig:
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
({
image: 'img/removed_settings.png',
colorMode: {
disableSwitch: true,
respectPrefersColorScheme: true,
},
navbar: {
title: 'sbt-github',
logo: {
alt: 'sbt-github Logo',
src: 'img/logo.svg',
},
items: [
{
type: 'doc',
docId: 'getting-started',
position: 'left',
label: 'Docs',
},
{
href: 'https://github.com/alejandrohdezma/sbt-github',
className: "header-github-link",
"aria-label": "GitHub repository",
position: 'right',
},
],
},
prism: {
theme: require('prism-react-renderer/themes/github'),
darkTheme: require('prism-react-renderer/themes/dracula'),
additionalLanguages: ['java', 'scala'],
},
}),
};

module.exports = config;
Loading

0 comments on commit 777bb35

Please sign in to comment.