Skip to content

Commit

Permalink
Merge pull request #173 from jaredwray/adding-in-website-support-with…
Browse files Browse the repository at this point in the history
…-docula

adding in website support with docula
  • Loading branch information
jaredwray committed Mar 7, 2024
2 parents dd6ba78 + 59155eb commit f01c0be
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy-site.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:

# Test
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ const ecto = new Ecto();

When looking at the API there are two main methods to make note of:
[render](#render-from-string) (async) - Render from a string.
[renderFromFile](#render-from-file) (async) - Renders from a file path and will auto-select what engine to use based on the file extension. It will return a Promise<string> of the rendered output.
[renderFromFile](#render-from-file) (async) - Renders from a file path and will auto-select what engine to use based on the file extension. It will return a `Promise<string>` of the rendered output.

Two key parameters to know are:
defaultEngine:string - the [default engine](#default-engine) to use and set by default to ejs.
Expand Down
4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"license": "MIT",
"scripts": {
"watch": "tsc -w -p .",
"clean": "rimraf ./dist yarn.lock package-lock.json ./coverage ./node_modules ./site/readme.md ./dist-site",
"clean": "rimraf ./dist yarn.lock package-lock.json pnpm-lock.yaml ./coverage ./node_modules ./site/readme.md ./dist-site",
"test": "xo --fix && vitest run --coverage",
"compile": "tsc -p .",
"build": "rimraf ./dist && npm install && npm run test && npm run compile",
Expand Down Expand Up @@ -67,9 +67,7 @@
"@types/pug": "^2.0.10",
"@types/underscore": "^1.11.15",
"@vitest/coverage-v8": "^1.3.1",
"docula": "0.4.0",
"rimraf": "^5.0.5",
"ts-node": "^10.9.2",
"typescript": "^5.3.3",
"vitest": "^1.3.1",
"webpack": "^5.90.3",
Expand Down
6 changes: 3 additions & 3 deletions site/docula.config.cjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const path = require('node:path');
const process = require('node:process');
const fsExtra = require('fs-extra');
const fs = require('node:fs');

module.exports.options = {
githubPath: 'jaredwray/ecto',
Expand All @@ -12,8 +12,8 @@ module.exports.options = {
module.exports.onPrepare = async config => {
const readmePath = path.join(process.cwd(), './README.md');
const readmeSitePath = path.join(config.sitePath, 'README.md');
const readme = await fsExtra.readFile(readmePath, 'utf8');
const readme = await fs.promises.readFile(readmePath, 'utf8');
const updatedReadme = readme.replace('![Ecto](ecto_logo.png "Ecto")\n\n', '');
console.log('writing updated readme to', readmeSitePath);
await fsExtra.writeFile(readmeSitePath, updatedReadme);
await fs.promises.writeFile(readmeSitePath, updatedReadme);
};

0 comments on commit f01c0be

Please sign in to comment.