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

Request: Github Wiki Support #47

Closed
favna opened this issue Jan 11, 2019 · 4 comments
Closed

Request: Github Wiki Support #47

favna opened this issue Jan 11, 2019 · 4 comments

Comments

@favna
Copy link

favna commented Jan 11, 2019

Right now my project awesome-querystring (as well as other projects) gets output to a whole slew of files and folders that are by no means GitHub Wiki compatible which expects all files in the root output folder and especially to not start with a _ as those are not displayed as potential pages.

Example of a GitHub wiki files tree for my discord bot project

image

So in short some requirements:

  • Spaces in the file names are replaced with -
  • No leading _, they are the GitHub proprietary files (like the footer and sidebar)
  • Output interfaces, enums, modules etc all to 1 single file otherwise end users are constantly loading files which is extremely bad UX.

In all honesty the ideal scenario I would want to be able to attain with Typedoc and thus this plugin is something like this markdown. Right now I achieve this through JSDoc but you can probably imagine it would be far more proper to use TypeDoc in a TypeScript based project.


google

Searches GoogleCommand - Gets information through Google

Note: prioritizes Knowledge Graphs for better searching

Aliases: search, g

Category: searches

Param Type Description
SearchQuery string

Thing to find on Google

Example

google Pyrrha Nikos

From these document tags:

/**
 * @file Searches GoogleCommand - Gets information through Google
 *
 * Note: prioritizes Knowledge Graphs for better searching
 *
 * **Aliases**: `search`, `g`
 * @module
 * @category searches
 * @name google
 * @example google Pyrrha Nikos
 * @param {string} SearchQuery Thing to find on Google
 */
@tgreyuk
Copy link
Member

tgreyuk commented Jan 11, 2019

thanks @favna i think this would be a useful addition - i will look into it

@msspshaw
Copy link

msspshaw commented Jul 3, 2019

@favna I'm guessing you've either solved this or moved on, but I've been using generating Typedoc documentation as markdown and uploading it to my Github Wiki - that project is private unfortunately, but I wrote this script to more nicely format the documentation for the wiki.
It does a few things:

  1. Flattens the docs (my output folder) folder structure - this obviously requires that no identically named files be generated in different levels of the tree, but I haven't encountered this yet.
  2. Strips out the folder structure in the generated markdown links.
  3. Strips out the .md extension in the markdown links (GIthub Wiki loads these as raw without this step).
# Update docs
yarn docs

# Flatten docs structure
cd docs
originalPaths=`find  . -mindepth 2 -type f`
find  . -mindepth 2 -type f -exec mv {} . \;
find . -type d -empty -delete

# Strip out folder structure from links to support Github Wiki
while read -r line; do
    # Remove leading ./ from each file name
    line=` sed "s|^./||" <<< $line `
    trimmedLine=` sed "s|.*/||" <<< $line `
    sed -i '' -e "s|${line}|${trimmedLine}|" *
done <<< "$originalPaths"

# Strip out .md from raw text to support Github Wiki
sed -i '' -e 's/.md//' *

# Return to <project>
cd ../

# Clone Wiki Repo
cd ../
git clone <project.wiki.git>

# Copy docs into wiki repo
cp -a <project>/docs/. <project>.wiki 

# Create commit and push in wiki repo
cd <project>.wiki
git add -A
git commit -m "Some Commit Message"
git push

All that said - I eagerly hope for a fully supported GitHub Wiki theme from @tgreyuk

@favna
Copy link
Author

favna commented Jul 4, 2019

Interesting @msspshaw. I have indeed moved on - these days I have a secondary tsconfig (tsconfig.docs.json) which extends my primary config overwriting the output folder and not removing comments. Then I use that to compile to JS, generate the docs with JSDoc-to-markdown and finally clean up the docs output folder again.

You can see an example of this in this library repo of mine. You can check package.json for the scripts that run, they're NPM scripts.

@jayarjo
Copy link

jayarjo commented Jun 1, 2020

So no support for GitHub friendly markdown?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants