This repository has been archived by the owner on Oct 2, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 0b82eff
Showing
20 changed files
with
1,527 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
insert_final_newline = true | ||
indent_size = 4 | ||
indent_style = tab | ||
|
||
[{package,package-lock}.json] | ||
indent_size = 2 | ||
indent_style = space | ||
|
||
[*.yml] | ||
indent_size = 2 | ||
indent_style = space | ||
|
||
[*.svg] | ||
insert_final_newline = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
name: Pages | ||
|
||
on: push | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v1 | ||
|
||
- name: Use Node.js 13.2 | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: 13.2 | ||
|
||
- name: npm install, build, and test | ||
run: | | ||
npm ci | ||
npm run build-docs | ||
env: | ||
CI: true | ||
|
||
- name: Deploy | ||
uses: JamesIves/github-pages-deploy-action@releases/v3 | ||
with: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
BRANCH: gh-pages | ||
FOLDER: build | ||
|
||
- name: Create Release | ||
id: create_release | ||
uses: actions/create-release@latest | ||
if: startsWith(github.ref, 'refs/tags/v') | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ github.ref }} | ||
release_name: Release ${{ github.ref }} | ||
draft: false | ||
prerelease: false | ||
|
||
- name: Upload minified CSS | ||
uses: actions/upload-release-asset@v1 | ||
if: startsWith(github.ref, 'refs/tags/v') | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: build/pr0gramm.min.css | ||
asset_name: pr0gramm.min.css | ||
asset_content_type: text/css | ||
|
||
- name: Upload CSS | ||
uses: actions/upload-release-asset@v1 | ||
if: startsWith(github.ref, 'refs/tags/v') | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: build/pr0gramm.css | ||
asset_name: pr0gramm.css | ||
asset_content_type: text/css | ||
|
||
- name: Publish Package | ||
if: startsWith(github.ref, 'refs/tags/v') | ||
run: | | ||
npm ci | ||
npm publish --access public | ||
env: | ||
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
build/ | ||
node_modules/ | ||
*.css | ||
*.map |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
*.js | ||
*.scss | ||
*.html | ||
*.map | ||
.*ignore | ||
.github | ||
.editorconfig | ||
build | ||
src |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# pr0gramm.css | ||
|
||
Ein Stylesheet für pr0gramm-esque Seiten. | ||
|
||
Dieses Stylesheet hat nichts mit dem offiziellen Stylesheet von pr0gramm zu tun. | ||
|
||
### [Dokumentation](https://holzmaster.github.io/pr0gramm.css) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
const fs = require("fs"); | ||
const hljs = require("highlightjs"); | ||
const child_process = require("child_process"); | ||
const outdent = require("outdent"); | ||
|
||
console.log("Bundling CSS..."); | ||
const npmOutput = child_process.execSync("npm run compile:prod", { encoding: "utf-8" }); | ||
console.log(npmOutput); | ||
|
||
const indexTemplate = fs.readFileSync("index.html", { encoding: "utf-8" }); | ||
|
||
console.log("Replacing variables..."); | ||
|
||
const correctedCss = indexTemplate | ||
.replace("build/pr0gramm.css", "pr0gramm.min.css") | ||
.replace("node_modules/highlightjs/styles/vs2015.css", "vs2015.css"); | ||
|
||
console.log("Highlighting code..."); | ||
|
||
const demoPattern = /\{\{(.+?);\n*(.+?)\n*\}\}/gis; | ||
|
||
const withDemoCode = correctedCss.replace(demoPattern, (_, language, codeToHighlight) => { | ||
const normalizedCode = outdent.string(codeToHighlight).trim(); | ||
return hljs.highlight(language, normalizedCode).value; | ||
}); | ||
|
||
console.log("Writing out files..."); | ||
|
||
fs.copyFileSync("node_modules/highlightjs/styles/vs2015.css", "build/vs2015.css"); | ||
fs.writeFileSync("build/index.html", withDemoCode); | ||
|
||
console.log("...done!"); |
Oops, something went wrong.