generated from mintlify/starter
-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #21 from projectdiscovery/new-js-docs
feat: new doc generator using typescript files
- Loading branch information
Showing
99 changed files
with
8,335 additions
and
1,990 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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: Build JS Protocol Docs | ||
name: Build JS Proto Modules Docs | ||
|
||
on: | ||
schedule: | ||
|
@@ -16,11 +16,14 @@ jobs: | |
- name: Setup Node Environment | ||
uses: actions/[email protected] | ||
|
||
- name: Install jsdoc-to-markdown | ||
run: npm install -g jsdoc-to-markdown | ||
- name: Set up Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: 1.21.x | ||
|
||
- name: Build JS Proto Docs | ||
run: ./bin/jsdocs.sh | ||
run: ./generate.sh | ||
working-directory: static/docsbuilder | ||
|
||
- name: Commit results to Github | ||
run: | | ||
|
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 |
---|---|---|
@@ -1,2 +1,4 @@ | ||
.DS_Store | ||
./nuclei/ | ||
/static/docsbuilder/node_modules/ | ||
/static/docsbuilder/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
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,59 @@ | ||
printf "\n\e[32m[*] Updating Nuclei Javascript Modules ...\e[0m\n" | ||
# clone nuclei | ||
git clone https://github.com/projectdiscovery/nuclei.git | ||
# branch | ||
export BRANCH=issue-4248-ts-docs | ||
|
||
# change directory | ||
cd nuclei | ||
# checkout to branch | ||
git checkout $BRANCH | ||
|
||
# generate documentation | ||
printf "\n\e[32m[*] Generating Typescript Files ...\e[0m\n" | ||
# generate typescript files | ||
make ts | ||
cd .. # change directory to root | ||
|
||
# copy typescript files | ||
printf "\n\e[32m[*] Copying Typescript Files ...\e[0m\n" | ||
cp -r nuclei/pkg/js/generated/ts src | ||
|
||
# setup typescript project | ||
printf "\n\e[32m[*] Download Typescript project dependencies ...\e[0m\n" | ||
npm install | ||
|
||
# run npm run build | ||
printf "\n\e[32m[*] Building Nuclei Typescript Modules ...\e[0m\n" | ||
npm run build | ||
|
||
# generate docs | ||
printf "\n\e[32m[*] Generate documentation ...\e[0m\n" | ||
npm run docs | ||
|
||
|
||
# post processing (rename .md to .mdx and remove .md in links) | ||
printf "\n\e[32m[*] Post Processing ...\e[0m\n" | ||
|
||
# rename .md to .mdx | ||
cd docs | ||
printf "\n\e[32m[*] Change extension from .md to .mdx ...\e[0m\n" | ||
for file in *.md; do mv "$file" "${file%.md}.mdx"; done | ||
|
||
# remove .md in links | ||
printf "\n\e[32m[*] Remove .md in links ...\e[0m\n" | ||
sed -i '' 's/\.md//g' *.mdx | ||
|
||
# move to appropriate directory | ||
cd ../../.. #project root | ||
mv static/docsbuilder/docs/* templates/protocols/javascript/modules/ | ||
|
||
# remove nuclei | ||
printf "\n\e[32m[*] Cleanup ...\e[0m\n" | ||
rm -rf static/docsbuilder/nuclei | ||
rm -rf static/docsbuilder/docs | ||
rm -rf static/docsbuilder/src | ||
rm -rf static/docsbuilder/node_modules | ||
|
||
# done | ||
printf "\n\e[32m[*] Done\e[0m\n" |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,35 @@ | ||
{ | ||
"name": "nuclei", | ||
"version": "1.0.0", | ||
"description": "Nuclei Javascript protocol Modules", | ||
"main": "index.js", | ||
"types": "./index.d.ts", | ||
"exports": { | ||
".": "./index.js" | ||
}, | ||
"scripts": { | ||
"build": "tsc", | ||
"docs": "node_modules/typedoc/bin/typedoc --plugin typedoc-plugin-markdown --plugin typedoc-github-wiki-theme --out docs --publicPath '/templates/protocols/javascript/modules/' src/index.ts" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/projectdiscovery/nuclei-js-types.git" | ||
}, | ||
"keywords": [ | ||
"nuclei", | ||
"js", | ||
"protocol", | ||
"types" | ||
], | ||
"author": "projectdiscovery", | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/projectdiscovery/nuclei-js-types/issues" | ||
}, | ||
"homepage": "https://github.com/projectdiscovery/nuclei-js-types#readme", | ||
"devDependencies": { | ||
"typedoc": "^0.25.7", | ||
"typedoc-github-wiki-theme": "^1.1.0", | ||
"typedoc-plugin-markdown": "^3.17.1" | ||
} | ||
} |
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,16 @@ | ||
{ | ||
"compilerOptions": { | ||
// "outDir": "./", // Output directory for all emitted files | ||
// "declaration": true, // Generates corresponding '.d.ts' file | ||
// "declarationDir": "./", // Output directory for declaration files | ||
"rootDir": "./src", // Specifies the root directory of input files | ||
// ... other options like "module", "target", etc. | ||
}, | ||
"include": [ | ||
"src/**/*.ts" // Include all TypeScript files in the src folder | ||
], | ||
"exclude": [ | ||
"node_modules", // Exclude the node_modules folder | ||
"**/*.test.ts" // Exclude test files | ||
] | ||
} |
Oops, something went wrong.