GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - fern-api/docs-custom-js-example: Fern Docs example with custom headers and footers

BranchesTags
Open more actions menu

Latest commit

 

History

27 Commits
27 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
custom-app
custom-app
 
 
fern
fern
 
 
.gitignore
.gitignore
 
 
README.md
README.md
 
 
package.json
package.json
 
 
yarn.lock
yarn.lock
 
 

Repository files navigation

Fern Docs: Custom Headers and Footers

This repo contains a basic react-app example that inserts a custom header and footer into Fern docs using custom JS and CSS.

Custom header

ReactDOM.render(
  React.createElement(NavHeader),
  document.getElementById('fern-header'),
)

Custom footer

ReactDOM.render(
  React.createElement(NavFooter),
  document.getElementById('fern-footer'),
)
Screenshot 2024-02-19 at 6 42 49 PM

Getting started

  1. cd custom-app
  2. yarn build
  3. fern generate --docs

Important notes

  1. This approach is subject to change as we make improvements to the plugin architecture
  2. ReactDOM.render() may need to be called multiple times to prevent it from unmounting (this side-effect will be removed in the future).
  3. yarn build or npm build must output dist files with deterministic names. This example uses this vite config to accomplish it. Then, reference the js/css files in the docs.yml to get picked up by Fern Docs.
  4. You may need to update your CD steps to include building the react-app.
  5. If you use tailwind, make sure to prefix the tailwind classes and disable preflight to deconflict with the Fern's stylesheet.

About

Fern Docs example with custom headers and footers

custom-js-example.docs.buildwithfern.com/

Topics

built-with-ferncustom-componentsmdx

Resources

Readme
Activity
Custom properties

Stars

2 stars

Watchers

2 watching

Forks

3 forks
Report repository

Releases

Used by

Contributors

Languages

Generated from fern-api/docs-starter
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.