Edit output documentation and preview locally

I've followed Documentation to export my documentation to publish in github pages.
I have to do some manual changes in the html and css but I can't figure out how to preview my changes locally. Can anyone point me the right direction?
I've tried run jekyll in the docs folder and also tried vscode live preview extension but all I get is blank pages.

Here are some troubleshooting steps you could take:

  • Check that you have a data directory alongside the others in the output directory. If you don't, that probably means there's a misconfiguration in your .docc bundle (like forgetting an Info.plist or not having a root page).
  • Make sure the URLs you're checking locally are correct. They'll always have /documentation/your-technology-name in there somewhere.
  • Check that your output directory, local web server, and --hosting-base-path are all in agreement with each other. Lots of local servers let you specify the root directory, so you need to pick one that's going to match up with the URLs you've configured DocC to generate. Even if you're seeing the correct index.html stubs show up, they essentially inspect their own URL path to figure out where to grab the content from.
1 Like

I would echo everything @krilnon said—great tips! Most importantly, if you're not seeing any .html files in the documentation folder from the output, then likely something went wrong with the DocC compilation itself.

Also, if you specifically want to be able to preview the website locally, you should be able to use some simple static http file server to preview the content.

As a basic example, you could copy your [path-to-docs-directory] with the HTML files into a folder called [hosting-base-path]. Then, you can cd [hosting-base-path] and run something like python3 -m http.server 4040 to start a local web server where you can access your docs at a URL like http://localhost:4040/[hosting-base-path]/documentation/[target-name] before you actually push/publish anything.

I'm not very familiar with the Jekyll commands, but there is likely something similar you can do to configure it to do the same local preview.