Skip to content

Commit

Permalink
Add versioned docs example
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewnicols committed Mar 28, 2022
1 parent 9922b0e commit 0b4fad2
Show file tree
Hide file tree
Showing 25 changed files with 1,217 additions and 111 deletions.
39 changes: 0 additions & 39 deletions docs/gettingstarted/index.md

This file was deleted.

71 changes: 71 additions & 0 deletions docs/gettingstarted/requirements.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
---
title: Technical requirements
---

Moodle is a PHP Application, which is backed by a relational database.

Five database types are supported, and several versions of PHP.

## PHP

Moodle 4.0 supports the following PHP versions:
- 7.3
- 7.4
- 8.0

The following PHP extensions are required (most of which are installed and enabled by default in most PHP installations):
- [iConv],
- [mbstring],
- [curl],
- [openssl],
- [ctype],
- [zip],
- [zlib],
- [simplexml],
- [spl],
- [pcre],
- [dom],
- [xml],
- [xmlreader],
- [intl],
- [json],
- [hash],
- [fileinfo]

## Relational Database

The following relational database servers are supported. The relevant PHP extension will also be required.
- [MariaDB][mariadb] (version 10.2.29 or higher) with the [MySQLi PHP Extension][php.mysqli]
- [MySQL][mysql] (version 5.7 or higher) with the [MySQLi PHP Extension][php.mysqli]
- [Postgresql][postgres] (version 10 or higher) with the [pgsql PHP Extension][php.pgsql]
- [Microsoft SQL Server][sqlsrv] (version 14.0 or higher) with the [SQLSRV PHP Extension][php.sqlsrv]
- [Oracle][oci] (version 11.2 or higher) with the [OCI8 PHP Extension][php.oci8]

[php]: https://php.net/downloads/
[iconv]: https://www.php.net/book.iconv
[mbstring]: https://www.php.net/book.mbstring
[curl]: https://www.php.net/book.curl
[openssl]: https://www.php.net/book.openssl
[ctype]: https://www.php.net/book.ctype
[zip]: https://www.php.net/book.zip
[zlib]: https://www.php.net/book.zlib
[simplexml]: https://www.php.net/book.simplexml
[spl]: https://www.php.net/book.spl
[pcre]: https://www.php.net/book.pcre
[dom]: https://www.php.net/book.dom
[xml]: https://www.php.net/book.xml
[xmlreader]: https://www.php.net/book.xmlreader
[intl]: https://www.php.net/book.intl
[json]: https://www.php.net/book.json
[hash]: https://www.php.net/book.hash
[fileinfo]: https://www.php.net/book.fileinfo

[mariadb]: https://mariadb.org/
[php.mysqli]: https://www.php.net/manual/en/book.mysqli.php
[mysql]: https://www.mysql.com/
[postgres]: https://www.postgresql.org/
[sqlsrv]: https://www.microsoft.com/en-au/sql-server/sql-server-downloads
[oci]: https://docs.oracle.com/cd/B19306_01/server.102/b14220/intro.htm
[php.oci8]: https://www.php.net/manual/en/book.oci8.php
[php.pgsql]: https://www.php.net/manual/en/book.pgsql.php
[php.sqlsrv]: https://www.php.net/manual/en/book.sqlsrv.php
5 changes: 0 additions & 5 deletions docs/guides/index.md

This file was deleted.

24 changes: 23 additions & 1 deletion docs/guides/javascript/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
title: JavaScript
---

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

Moodle makes heavy use of JavaScript to improve the experience for its users.

Expand Down Expand Up @@ -471,16 +473,36 @@ in the background to build just the files you change as you write them.

#### Installing grunt

<Tabs>
<TabItem value="globalgrunt" label="Global">

```console
$ npm -g install grunt-cli
npm -g install grunt-cli
```

</TabItem>
</Tabs>

#### Using grunt


<Tabs>
<TabItem value="npx_grunt" label="NPX">

```bash
npx grunt
```

</TabItem>
<TabItem value="global_grunt" label="Global">

```bash
grunt
```

</TabItem>
</Tabs>

### ESLint

## Glossary
Expand Down
49 changes: 5 additions & 44 deletions docs/intro.md
Original file line number Diff line number Diff line change
@@ -1,47 +1,8 @@
---
sidebar_position: 1
id: introduction
title: Introduction
description: Moodle developer documentation
slug: /
---

# Tutorial Intro

Let's discover **Docusaurus in less than 5 minutes**.

## Getting Started

Get started by **creating a new site**.

Or **try Docusaurus immediately** with **[docusaurus.new](https://docusaurus.new)**.

### What you'll need

- [Node.js](https://nodejs.org/en/download/) version 14 or above:
- When installing Node.js, you are recommended to check all checkboxes related to dependencies.

## Generate a new site

Generate a new Docusaurus site using the **classic template**.

The classic template will automatically be added to your project after you run the command:

```bash
npm init docusaurus@latest my-website classic
```

You can type this command into Command Prompt, Powershell, Terminal, or any other integrated terminal of your code editor.

The command also installs all necessary dependencies you need to run Docusaurus.

## Start your site

Run the development server:

```bash
cd my-website
npm run start
```

The `cd` command changes the directory you're working with. In order to work with your newly created Docusaurus site, you'll need to navigate the terminal there.

The `npm run start` command builds your website locally and serves it through a development server, ready for you to view at http://localhost:3000/.

Open `docs/intro.md` (this page) and edit some lines: the site **reloads automatically** and displays your changes.
Welcome to the new Moodle Developer documentation, your main resource in Moodle development.
9 changes: 9 additions & 0 deletions docs/release-notes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
title: Release notes
---

# Release notes

:::note
This page contains release notes for the upcoming version of Moodle.
:::
53 changes: 46 additions & 7 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,17 @@
const lightCodeTheme = require('prism-react-renderer/themes/github');
const darkCodeTheme = require('prism-react-renderer/themes/dracula');

const VersionsArchived = require('./versionsArchived.json');
const ArchivedVersionsDropdownItems = Object.entries(VersionsArchived).splice(
0,
5,
);


/** @type {import('@docusaurus/types').Config} */
const config = {
title: 'Moodle Developer Documentation',
tagline: 'Dinosaurs are cool',
title: 'Moodle',
tagline: 'Official Developer Documentation',
//url: 'https://develop.moodle.org',
//baseUrl: '/',
url: 'https://andrewnicols.github.io',
Expand All @@ -16,7 +23,7 @@ const config = {
onBrokenLinks: 'throw',
onBrokenMarkdownLinks: 'warn',
favicon: 'img/favicon.ico',
organizationName: 'moodlehq', // Usually your GitHub org/user name.
organizationName: 'moodle', // Usually your GitHub org/user name.
projectName: 'devdocs', // Usually your repo name.

presets: [
Expand Down Expand Up @@ -56,26 +63,58 @@ const config = {
type: 'doc',
docId: 'gettingstarted/quickstart',
position: 'left',
label: 'Tutorial',
label: 'Guides',
},
{to: '/blog', label: 'Blog', position: 'left'},
//{to: '/docs/community', label: 'Community', position: 'left'},
{to: '/community', label: 'Community', position: 'left'},

// Right.
{
type: 'docsVersionDropdown',
position: 'right',
dropdownActiveClassDisabled: true,
dropdownItemsAfter: [
...ArchivedVersionsDropdownItems.map(
([versionName, versionUrl]) => ({
label: versionName,
href: versionUrl,
}),
),
{
href: 'https://docs.moodle.org/dev/',
label: 'Legacy documentation',
},
{
to: '/versions',
label: 'All versions',
},
],
},
{
href: 'https://github.com/moodle/moodle',
label: 'GitHub',
position: 'right',
},
],
},

// Customisation for the left sidebar:
autoCollapseSidebarCategories: true,
hideableSidebar: true,

footer: {
style: 'dark',
links: [
{
title: 'Docs',
items: [
{
label: 'Tutorial',
to: '/docs/intro',
label: 'User docs',
href: 'https://docs.moodle.org/',
},
{
label: 'Legacy docs',
href: 'https://docs.moodle.org/dev/',
},
],
},
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "devdocs",
"version": "0.0.0",
"version": "4.0",
"private": true,
"scripts": {
"docusaurus": "docusaurus",
Expand Down
59 changes: 47 additions & 12 deletions sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,54 @@

/** @type {import('@docusaurus/plugin-content-docs').SidebarsConfig} */
const sidebars = {
// By default, Docusaurus generates a sidebar from the docs folder structure
docsSidebar: [{type: 'autogenerated', dirName: '.'}],
docs: [
'introduction',
{
label: 'Getting started',
type: 'category',
items: [
'gettingstarted/quickstart',
'gettingstarted/requirements',
'gettingstarted/setup',
],
},
{
label: 'Developer guides',
type: 'category',
items: [
{
type: 'autogenerated',
dirName: 'guides',
},
],
},
{
label: 'Policies',
type: 'category',
items: [
{
type: 'autogenerated',
dirName: 'policy',
},
],
},
{
label: 'Tooling',
type: 'category',
items: [
{
type: 'autogenerated',
dirName: 'tools',
},
],
},
{
type: 'html',
value: '<hr>',
},

// But you can create a sidebar manually
/*
tutorialSidebar: [
{
type: 'category',
label: 'Tutorial',
items: ['hello'],
},
],
*/
'release-notes',
],
};

module.exports = sidebars;
Loading

0 comments on commit 0b4fad2

Please sign in to comment.