• Stars
    star
    107
  • Rank 322,588 (Top 7 %)
  • Language Vue
  • License
    MIT License
  • Created over 6 years ago
  • Updated almost 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

VuePress theme for Craft CMS documentation

Craft Documentation Theme for VuePress

This is the VuePress theme used for Craft CMS documentation.

It makes the following changes over the default VuePress theme:

  • Adds support for code language toggles and split page views.
  • Disables interpolation for all inline <code> tags.
  • Improves <table> styling.
  • Adds themeConfig options to tweak sidebar sizing: smallerSidebarHeadings and widerSidebar. (Each false by default.)

Setup

  1. Install VuePress like normal

  2. Require this theme

    yarn add -D vuepress-theme-craftdocs # or npm install -D vuepress-theme-craftdocs
    
  3. Set these things in .vuepress/config.js:

    module.exports = {
      // ...
      theme: "craftdocs",
      themeConfig: {
        // ...
        codeLanguages: {
          php: "PHP",
          twig: "Twig",
          // any other code language labels you want to include in code toggles...
        },
      },
      markdown: {
        anchor: { level: [2, 3] },
        extendMarkdown(md) {
          let markup = require("vuepress-theme-craftdocs/markup");
          md.use(markup);
        },
      },
    };

Code Toggles

You can create code toggles by wrapping multiple fenced code blocks with a code container:

::: code

```php
echo "Hey, $name";
```

```twig
Hey, {{ name }}
```

:::

By default, toggle labels will be pulled from the value in themeConfig.codeLanguages that matches the code block’s language. If you want to provide a custom label instead, just type it after the code block language:

::: code

```php Craft 2
$success = craft()->entries->saveEntry($entry);
```

```php Craft 3
$success = Craft::$app->elements->saveElement($entry);
```

:::

Split Views

You can create split view pages by adding split: true to your page’s frontmatter:

---
split: true
---

In split view, any content that contains a horizontal rule (---) will be divided into left and right portions, starting and ending at the closest H2/H3 headings.

## Cool Headings

Left-side content

---

Right-side content

In split view, code toggles can share a single page-wide toggle UI, floated at the top of the right-hand content pane. To do this, add a code list to your page’s frontmatter:

---
split: true
code:
  - php
  - twig
---

(Use the same language handles defined by themeConfig.codeLanguages in .vuepress/config.js.)

Upgrading from v1.3.x

  1. Follow the VuePress Migration from 0.x guide.
  2. Update any custom styles that relied on .content to reference .theme-default-content instead.
  3. If you’re using Algolia DocSearch, make sure your index configuration’s selectors are still valid.

More Repositories

1

ontherocks

CSS
107
star
2

DigitalProducts

Sell digital products with Craft Commerce
PHP
50
star
3

CategorySources

View your entries by their category-based taxonomies in Craft
PHP
47
star
4

Events

Sample Craft plugin demonstrating element types
PHP
41
star
5

CodingStandards

Pixel & Tonic’s official coding standards for Craft and other projects
40
star
6

garnishjs

UI toolkit by Pixel & Tonic
JavaScript
39
star
7

matrix_multi_upload

Upload multiple files to Matrix at once, powered by Plupload
CSS
36
star
8

pt_field_pack

Enhanced replacements for the Checkboxes, Select Dropdown, Multi Select, and Radio Buttons fieldtypes bundled with EE2
PHP
35
star
9

ColdCache

A cold-hearted cache tag for Craft.
PHP
24
star
10

RedactorI

Provides a “Redactor I” field type for Craft CMS based on the legacy version of Redactor.
JavaScript
20
star
11

AssetSubfolderAccess

Limits user groups to only access certain asset subfolders
PHP
17
star
12

CommerceEasyPost

Easy Post shipping plugin for Craft Commerce
PHP
17
star
13

cp_css_js

Allows you to add custom CSS and JS to the Control Panel pages
PHP
17
star
14

PowerNap

Sample Task plugin
PHP
15
star
15

Parsedown

Parsedown plugin for Craft
PHP
15
star
16

CommerceStockNotifier

Notifies store administrators when a Craft Commerce site is running low on stock
PHP
12
star
17

matrix_url_title

Unique URL Title celltype for Matrix on EE2
PHP
11
star
18

craft-fixfks

Scripts for restoring missing foreign keys on a Craft install
PHP
9
star
19

fieldframe

Fieldtype framework for EE1
PHP
8
star
20

BigDates

Shows the full timestamp for Post and Expiry dates on Entry indexes in Craft CMS.
PHP
6
star
21

CommerceCurrencyRates

Example plugin to show how to update currency rates from an API
PHP
6
star
22

pt_switch

Sliding “lightswitch” fieldtype for EE1 and EE2 with customizable labels and values
PHP
6
star
23

wygwam_upload_tags

EE2 extension that parses Wygwam’s Upload Directory settings for {username}, {member_id}, and {group_id}
PHP
6
star
24

RedactorStyles

Adds the “Styles” plugin to Rich Text fields in Craft
JavaScript
6
star
25

craftcommerce-ogone

PHP
6
star
26

pt_list

List-making fieldtype for EE1 and EE2 with sortable, editable, and deletable rows
PHP
5
star
27

Iterate

EE2 plugin that iterates through one or more pipe-delimited strings, passed in as parameters
PHP
5
star
28

wygwam_super_admin_source

EE2 extension forces Wygwam’s “Source” toolbar button to always show up for Super Admins
PHP
5
star
29

wygwam_structure_pages

ExpressionEngine extension that adds Structure pages as a Link Type in Wygwam’s Link dialog
PHP
5
star
30

pt_pill

Pill select fieldtype for EE1 and EE2 with customizable option labels and values
PHP
5
star
31

prompt

A Go package to ask for user input on the command line
Go
4
star
32

matrix_radio_group

Turns your entire Matrix field into a big radio group, where each row gets a single radio button
PHP
4
star
33

FF2EE2

FieldFrame-to-EE2 Data Converter
PHP
4
star
34

assets_expiry_date

EE2 extension that adds an Expiry Date metadata field to file HUDs
PHP
4
star
35

matrix_comments

EE2 extension that enables per-Matrix-row commenting
PHP
4
star
36

wygwam_template_links

ExpressionEngine extension that adds a “Templates” Link Type to Wygwam’s Link dialog
PHP
3
star
37

wygwam_no_upload_tab

Removes the “Upload” tabs from the Link, Image, and Flash dialogs, forcing authors to click the “Browse Server” buttons and upload files via CKFinder
PHP
3
star
38

craftcommerce-wirecard

PHP
2
star
39

numstyle

EE2 plugin that converts numbers to letters or roman numerals
PHP
2
star
40

DotAllCommerceBerlin2018

Commerce Workshop Berlin 2018
HTML
2
star
41

matrix_tidy_cols

EE1 extension that cleans up your Matrix field-column associations after duplicating a site with MSM.
PHP
2
star
42

flysystem-google-cloud

Google Cloud adapter for Flysytem
PHP
1
star
43

craftui

JavaScript
1
star