Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding in website support with docula #173

Merged
merged 1 commit into from
Mar 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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);
};
Loading