Skip to content

Commit

Permalink
Upgrade website and documentation to Docusaurus (#187)
Browse files Browse the repository at this point in the history
* Initial merge of boilerplate docusaurus site with existing Vue based site. Kept only minimal overlapping files to avoid cruft removal later. Will port existing components, scripts and pages into docusaurus setup in subsequent commits.

* Script to generate API mdx files from turf jsdoc comments. Working for most 6.5.0 single function packages. Need to update for packages like helpers and meta that contain multiple exported functions. Includes component to display maps derived from jsdoc @example tags.

* API generation working for multiple function modules such as turf-helpers.

* Trying a greyscale map type. Changed parameters to be table based. Source returns information from a different section of the documentation.js output that separates out embedded links.

* Fix a bug in **strong** handling. Take a less naive approach in _emphasis_ as well.

* Rolling back to documentation.js 13.2.4 as 13.2.5 doesn't seem to handle inline {@link } tags very well.

* Generating API sidebar automatically from documentation.yml. Prettifying generated typescript and MDX to improve visibility of any manual tweaks we need to make post versioning.

* Checking in first version of 6.5.0 docs MDX.

* Wrapping example maps in a <BrowserOnly> tag. Ran into problems building a production site for deployment. Our old friend "rbush is not a constructor" was not playing well with server side generation. Seems to work ok in the browser though.

* Moving CNAME file to recommended location according to docusaurus deployment docs.

* Manually tweaking a couple of functions that we just can't clearly generate docs for. Mainly malformed JSDoc in the 6.5.0 source.

* Stop prettier from adding a trailing semicolon after map MDX. Semicolon was showing up under map in API webpages.

* Couldn't get prettier to work consistently wrt trailing semicolon after <Map /> line, so adding a prettier ignore line above it. Removing a couple of packages that weren't documented or exported in @turf/turf 6.5.0. They're not in the CDN version that the website uses, so will reintroduce them once v7 is on the CDN instead.

* Couldn't get prettier to work consistently wrt trailing semicolon after <Map /> line, so adding a prettier ignore line above it. Removing a couple of packages that weren't documented or exported in @turf/turf 6.5.0. They're not in the CDN version that the website uses, so will reintroduce them once v7 is on the CDN instead.

* Migrating turf top level README.md and CONTRIBUTING.md over into docs/ area.

* Fixing broken or outdated links. Some minor heading changes to make RHS nav bar more sensible.

* Adding a quick blog entry for the website upgrade.

* Adding home page map functionality, albeit in need of some styling.

* Getting the demo map on the home page working to show the effect of different Turf functions. Fixing some footer links.

* Updating github actions to try to get PR building.

* Didn't specify the node version correctly. Removing the strategy matrix - probably don't need it for generating documentation?
  • Loading branch information
smallsaucepan authored May 31, 2024
1 parent ab3b935 commit df38d45
Show file tree
Hide file tree
Showing 255 changed files with 38,211 additions and 9,220 deletions.
19 changes: 0 additions & 19 deletions .eslintrc.js

This file was deleted.

11 changes: 4 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,12 @@ on:

jobs:
build:
strategy:
matrix:
version: [14, 16]
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 14
node-version: 20
- run: npm install
- run: npm run generate
- run: npm run build
28 changes: 17 additions & 11 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
# dependencies
node_modules
package-lock.json
yarn.lock
# logs
npm-debug.log
# Dependencies
/node_modules

# Nuxt build
.nuxt
# Production
/build

# Nuxt generate
dist
# Generated files
.docusaurus
.cache-loader

.vscode
# Misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*
1 change: 0 additions & 1 deletion .nvmrc

This file was deleted.

49 changes: 26 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,38 +1,41 @@
# turf-www

This repository keeps the source code of the Turf website project. Basically it uses **Vue.js** in the components and **Nuxt.js** to generate the static bundle that could be served to the client.
This repository keeps the source code of the Turf website project. The website is built using [Docusaurus](https://docusaurus.io/), a modern static website generator.

To run this project in your local machine you need to have installed:
### Installation

* Node.js
* NPM
```
$ yarn
```

Then with Git you can clone the repository to a local folder and continue the development process that is described below.
### Local Development

## Development Setup
```
$ yarn start
```

``` bash
# clone the repository to a local folder
$ git clone https://github.com/Turfjs/turf-www.git
This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.

# go to the local folder
$ cd turf-www/
### Build

# install dependencies
$ npm install # Or yarn install
```
$ yarn build
```

# serve with hot reload at localhost:3000
$ npm start
This command generates static content into the `build` directory and can be served using any static contents hosting service.

# generate static project
# the files will be located in docs/
$ npm run generate
### Deployment

# go to the generated pages
$ cd docs/
Using SSH:

# serve the project with a static server
$ npx static-server
```
$ USE_SSH=true yarn deploy
```

Not using SSH:

```
$ GIT_USER=<Your GitHub username> yarn deploy
```

For detailed explanation on how things work, checkout the [CONTRIBUTING.md](https://github.com/Turfjs/turf-www/blob/master/CONTRIBUTING.md)
If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch.
Loading

0 comments on commit df38d45

Please sign in to comment.