Taming DocFx to match SHFB features #1153
Replies: 8 comments
-
|
Outstanding! I like the look and plan on checking it out. Can it run as a Github Action? |
Beta Was this translation helpful? Give feedback.
-
|
Glad you like it. Yes, you can use it as a Github Action: Publish to GitHub Pages:Create a workflow file in your repository, e.g. # Your GitHub workflow file under .github/workflows/
# Trigger the action on push to main
on:
push:
branches:
- main
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
actions: read
pages: write
id-token: write
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
publish-docs:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Dotnet Setup
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.x
- run: dotnet tool update -g docfx-plus
- run: docfx-plus docfx.json
# use working-directory for docfx step otherwise codeSourceBasePath is not resolved correctly
working-directory: docs
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
# Upload entire repository
path: 'docs/_site'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4Then enable GitHub Actions for your repository's Pages settings as described here: Now whenever you commit, your action will run automatically and publish your docs. For example, this action is used live here: https://github.com/dotmake-build/command-line/blob/main/.github/workflows/publish-docs.yml |
Beta Was this translation helpful? Give feedback.
-
|
FYI, I am currently working on adding a |
Beta Was this translation helpful? Give feedback.
-
|
@calacayir In your comment above you note your reason for switching to docfx is that the theme and architecture in SHFB are outdated. Being so close to the project, I don't always see its shortcomings and issues with usage unless someone takes the time to report them or asks for a change. Things I do know:
I'm interested to know what else you see as limitations or what else is outdated in SHFB that make docfx preferable. |
Beta Was this translation helpful? Give feedback.
-
|
@EWSoftware Yes, the main reason is MAML is hard to write than markdown, especially when you want to update docs. Also SHFB does not support latest @StephenHidem As promised, I have just released DocFx-Plus v2.0.0 (it was a heavier job than I expected) which adds new
Sample OutputsThese documentation projects are converted from SHFB to Docfx-Plus: |
Beta Was this translation helpful? Give feedback.
-
|
@calacayir What inheritdoc features aren't supported? As far as I know there's only two attributes (cref and path) and both are supported. |
Beta Was this translation helpful? Give feedback.
-
|
I mean for example dotnet now imports /// <inheritdoc cref="CliParser.Parse(string)" />
/// <typeparam name="TDefinition"><inheritdoc cref="GetParser{TDefinition}" path="/typeparam[@name='TDefinition']/node()" /></typeparam>
/// <param name="settings"><inheritdoc cref="GetParser{TDefinition}" path="/param[@name='settings']/node()" /></param>
/// <example>
/// <code source="../TestApp/CliExamples.cs" region="CliParseStringWithResult" language="cs" />
/// </example>
public static CliResult Parse<TDefinition>(string commandLine, CliSettings settings = null)
{
var parser = GetParser<TDefinition>(settings);
return parser.Parse(commandLine);
}So |
Beta Was this translation helpful? Give feedback.
-
|
SHFB's |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
We used SHFB for many years mainly because of its excellent
<code>block andNamespaceDocsupport and it had been very stable but imho its theme and architecture is a bit outdated. DocFx is great in many ways but it misses some important features that we got used to with SHFB. So I created a new project docfx-plus to enhance DocFx. My aim was to update existing project docs that depend on some SHFB features, without changes to xml comments, to DocFx. Check it out and let me know what you think.Live Demo - Sample API docs result for our other project DotMake Command-Line.
Beta Was this translation helpful? Give feedback.
All reactions