Skip to content

Commit 5ee1632

Browse files
authoredJul 15, 2022
Merge pull request #305 from sharidas/component_library
[doc] Migrate component library
2 parents 5ffd724 + 2c2c61c commit 5ee1632

File tree

4 files changed

+69
-6
lines changed

4 files changed

+69
-6
lines changed
 

‎data/migratedPages.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,9 @@ Community_credits:
7070
Component_Lead_Review:
7171
- filePath: "/general/development/process/integration/clr.md"
7272
slug: "/general/development/process/integration/clr"
73+
Component_library:
74+
- filePath: "/general/development/tools/component-library.md"
75+
slug: "/general/development/tools/component-library"
7376
Contributing_a_translation:
7477
- filePath: "/general/development/process/translation/contributing.md"
7578
slug: "/general/development/process/translation/contributing"
@@ -1197,9 +1200,6 @@ Moodle_4.0_developer_update:
11971200
Moodle_4.0_release_notes:
11981201
- filePath: "/general/releases/4.0.md"
11991202
slug: "/general/releases/4.0"
1200-
Moodle_and_PHP:
1201-
- filePath: "/general/development/policies/php.md"
1202-
slug: "/general/development/php"
12031203
Moodle_App:
12041204
- filePath: "/general/app.md"
12051205
slug: "/general/app"
@@ -1392,6 +1392,9 @@ Moodle_Mobile_3.9.5_release_notes:
13921392
Moodle_Penetration_Testing:
13931393
- filePath: "/general/development/process/security/penetration-testing.md"
13941394
slug: "/general/development/process/security/penetration-testing"
1395+
Moodle_and_PHP:
1396+
- filePath: "/general/development/policies/php.md"
1397+
slug: "/general/development/php"
13951398
Moodle_libraries_credits:
13961399
- filePath: "/general/community/credits/thirdpartylibs.md"
13971400
slug: "/general/community/credits/thirdpartylibs"

‎general/development/policies.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ It includes components from both Twitter Bootstrap, and from Moodle, and it disp
114114

115115
:::info
116116

117-
For more about this, see [Component library](https://docs.moodle.org/dev/Component_library).
117+
For more about this, see [Component library](./tools/component-library.md).
118118

119119
:::
120120

‎general/development/process/peer-review.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ Ensure that:
6969

7070
### Component library
7171

72-
Any improvement or new feature that introduces UI features to Moodle core from Moodle 4.0 onwards must be documented within the [Component library](https://docs.moodle.org/dev/Component_library).
72+
Any improvement or new feature that introduces UI features to Moodle core from Moodle 4.0 onwards must be documented within the [Component library](../tools/component-library.md).
7373

7474
This applies to any feature introduced or updated from Moodle 4.0 onwards, which:
7575

@@ -80,7 +80,7 @@ This applies to any feature introduced or updated from Moodle 4.0 onwards, which
8080

8181
Ensure that any new User Interface feature in Moodle 4.0 or later which matches the above criteria:
8282

83-
- Is documented in the [Component library](https://docs.moodle.org/dev/Component_library)
83+
- Is documented in the [Component library](../tools/component-library.md)
8484
- Includes examples of usage
8585
- Has appropriate descriptions
8686
- Respects all Moodle-supplied themes
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
---
2+
title: Component library
3+
tags:
4+
- Coding_guidelines
5+
- Core_development
6+
- Developer_tools
7+
- Guidelines_for_contributors
8+
- Interfaces
9+
- Moodle_User_Interface_Guidelines
10+
- Processes
11+
- Themes
12+
- Usability
13+
---
14+
15+
The Component Library is a developer tool provided to help identify frequently-used user interface components, and encourage their re-use.
16+
17+
It includes components from both Twitter Bootstrap, and from Moodle, and it displays these features using your current Moodle theme.
18+
19+
This should help you to work on your theme features, bringing together most of Moodle into one convenient location.
20+
21+
The library is a tool for visual designers, front-end developers, UX developers and anybody creating core Moodle code or Moodle extensions. Its use will allow you to create user interfaces more efficiently.
22+
23+
## Getting started
24+
25+
### Where is the Component Library?
26+
27+
The library is built right into Moodle, but is only shown to developers. You can find it in your site by navigating to Site administration -> Development -> UI Component library.
28+
29+
If you cannot see "UI Component library" then you will need to build it first - see below.
30+
31+
You can also browse the Component Library online http://componentlibrary.moodle.com/admin/tool/componentlibrary/docspage.php/library/getting-started/
32+
33+
### Building the Component Library
34+
35+
The Component Library is written using the same Hugo tooling that the Twitter Bootstrap framework uses. It also includes the Bootstrap libraries for the version of Bootstrap used in Moodle.
36+
37+
The library is built from your console, and you will need to install the same NodeJS dependencies that we use for many of our other development features.
38+
39+
See our [Grunt](https://docs.moodle.org/dev/Grunt) documentation for information on how to install these dependencies.
40+
41+
Once you have installed the NodeJS dependencies you can then use the [grunt](http://gruntjs.com/) tooling to build the library.:
42+
43+
```console title="Building the component library"
44+
grunt componentlibrary
45+
```
46+
47+
Simples! What could be easier!?
48+
49+
### What should be documented
50+
51+
The main aim of this library is to improve consistency of the user interface to provide a better user (and developer) experience by re-using components across Moodle.
52+
53+
Whenever a new Moodle feature is created or updated, the building blocks for the UI of the feature should be documented in this library.
54+
55+
The initial aim is to document any new UI feature which:
56+
57+
- is made available in the `core` component, or any core subsystem
58+
- is made available for re-use in a plugin which offers sub-plugins
59+
60+
The documentation of other features will also be welcomed.

0 commit comments

Comments
 (0)