Skip to content
This repository was archived by the owner on Mar 5, 2025. It is now read-only.

Commit c163b6f

Browse files
authored
Mkdocs (#270)
* fixing code blocks on readthedocs. * fixing code blocks on readthedocs. * Removing named anchors. * Fixing indentation.
1 parent 1548dd7 commit c163b6f

11 files changed

+136
-186
lines changed

INSTALL.md

+48-63
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,5 @@
11
# BLT installation and updates
22

3-
* System requirements
4-
* [Creating a new project with BLT](#creating-new)
5-
* [Adding BLT to an existing project](#existing-project)
6-
* [Updating to the latest version of BLT](#updating)
7-
* [Updating from a non-composer-managed version](#update-non-composered)
8-
* [Updating a composer-managed version](#update-composered)
9-
103
## System Requirements
114

125
You should be able to use the following tools on the command line of your native operating system:
@@ -23,99 +16,90 @@ You should be able to use the following tools on the command line of your native
2316

2417
* Globally install pretissimo for parallelized composer downloads:
2518

26-
```
27-
composer global require "hirak/prestissimo:^0.3"
28-
```
19+
composer global require "hirak/prestissimo:^0.3"
20+
2921
* If you have xDebug enabled for your PHP CLI binary, it is highly recommended that you disable it to dramatically improve performance.
3022

31-
## <a name="creating-new"></a>Creating a new project with BLT
23+
## Creating a new project with BLT
3224

3325
1. Create a new project using the [blt-project](https://github.com/acquia/blt-project) template:
3426

35-
```
36-
composer create-project acquia/blt-project:8.x-dev MY_PROJECT --no-interaction
37-
cd MY_PROJECT
38-
```
27+
composer create-project acquia/blt-project:8.x-dev MY_PROJECT --no-interaction
28+
cd MY_PROJECT
29+
3930
1. Install the `blt` alias and follow on-screen instructions:
4031

41-
```
42-
./vendor/bin/blt install-alias
43-
```
32+
./vendor/bin/blt install-alias
33+
4434
1. Customize BLT configuration files:
45-
* `project.yml`
46-
* `docroot/sites/default/settings/local.settings.php`
47-
* Add your local DB credentials to `$databases`
35+
* `project.yml`
36+
* `docroot/sites/default/settings/local.settings.php`
37+
* Add your local DB credentials to `$databases`
4838
1. Replace tokens in new BLT-generated files with your custom values in project.yml:
4939

50-
```
51-
blt configure
52-
```
40+
41+
blt configure
42+
5343
1. (optional) Modify project files. Important files that you may want to modify include:
54-
* composer.json. Note that Drupal core, contrib, and third party dependencies are all managed here.
55-
* Project’s root README.md.
56-
* Other project documentation in the readme directory.
44+
* composer.json. Note that Drupal core, contrib, and third party dependencies are all managed here.
45+
* Project’s root README.md.
46+
* Other project documentation in the readme directory.
5747
1. (optional) Follow instructions for <a href="#install">installing Drupal locally</a>.
5848

59-
## <a name="existing-project"></a>Adding BLT to an existing project
49+
## Adding BLT to an existing project
6050

6151
To add BLT to a pre-existing Drupal project, do the following:
6252

6353
1. Ensure that your project directory structure is Acquia-cloud compatible by asserting that the Drupal root is in a top-level folder called `docroot`.
6454
1. If you currently manage your dependencies via Composer, ensure that they are all up to date via `composer update`. Assert that these updates do not break your project.
6555
1. `cd` into your existing project directory.
6656
1. Add BLT via composer and initialize it:
67-
```
68-
composer require acquia/blt:~8
69-
./vendor/acquia/blt/blt.sh init
70-
```
57+
58+
composer require acquia/blt:~8
59+
./vendor/acquia/blt/blt.sh init
60+
7161
1. (optional) Modify project files. Important files that you may want to modify include:
72-
* composer.json. Note that Drupal core, contrib, and third party dependencies are all managed here.
73-
* Project’s root README.md.
74-
* Other project documentation in the readme directory.
62+
* composer.json. Note that Drupal core, contrib, and third party dependencies are all managed here.
63+
* Project’s root README.md.
64+
* Other project documentation in the readme directory.
7565
1. (optional) Follow instructions for <a href="#install">installing Drupal locally</a>.
7666

77-
## <a name="updating"></a>Updating BLT
67+
## Updating BLT
7868

79-
### <a name="update-composered"></a>Updating a composer-managed version
69+
### Updating a composer-managed version
8070

8171
If you are already using BLT via Composer, you can update to the latest version of BLT by running the following commands from your project's root directory:
8272

83-
```
84-
composer update acquia/blt
85-
blt update
86-
```
73+
composer update acquia/blt
74+
blt update
75+
8776

88-
### <a name="update-non-composered"></a>Updating from a non-Composer-managed version
77+
### Updating from a non-Composer-managed version
8978

9079
If you are using an older version of BLT that was not installed using Composer, you may update to the Composer-managed version by running the following commands:
9180

9281
1. Remove any dependencies that may conflict with upstream acquia/blt. You may add these back later after the upgrade, if necessary.
9382

94-
```
95-
composer remove drush/drush drupal/console phing/phing phpunit/phpunit squizlabs/php_codesniffer symfony/yaml drupal/coder symfony/console --no-interaction --no-update
96-
composer remove drush/drush drupal/console phing/phing phpunit/phpunit squizlabs/php_codesniffer symfony/yaml drupal/coder symfony/console --dev --no-interaction --no-update
97-
composer config minimum-stability dev
98-
```
83+
composer remove drush/drush drupal/console phing/phing phpunit/phpunit squizlabs/php_codesniffer symfony/yaml drupal/coder symfony/console --no-interaction --no-update
84+
composer remove drush/drush drupal/console phing/phing phpunit/phpunit squizlabs/php_codesniffer symfony/yaml drupal/coder symfony/console --dev --no-interaction --no-update
85+
composer config minimum-stability dev
86+
9987
1. (conditional) If you are using Lightning, verify that your version constraint allows it to be updated to the latest stable version:
10088

101-
```
102-
composer require drupal/lightning:~8 --no-update
103-
```
89+
composer require drupal/lightning:~8 --no-update
90+
10491
1. Require acquia/blt as a dev dependency:
10592

106-
```
107-
composer require acquia/blt:~8 --dev --no-update
108-
```
93+
composer require acquia/blt:~8 --dev --no-update
94+
10995
1. Update all dependencies:
11096

111-
```
112-
composer update
113-
```
97+
composer update
98+
11499
1. Execute update script:
115100

116-
```
117-
./vendor/acquia/blt/scripts/blt/convert-to-composer.sh
118-
```
101+
./vendor/acquia/blt/scripts/blt/convert-to-composer.sh
102+
119103

120104
Note that all of the steps from this point forward are the same steps that would be used by a newly onboarded developer setting up your existing project on their local machine for the first time.
121105

@@ -124,16 +108,17 @@ Note that all of the steps from this point forward are the same steps that would
124108
Before building your project dependencies and installing Drupal, you must have a fully functional \*AMP stack on your local machine. BLT intentionally does not provide this local development environment--that is outside of the scope of BLT’s intended responsibilities. It does, however, make recommendations for which tools you should use to manage your stack.
125109

126110
Please see [Local Development](template/readme/local-development.md) for more information on setting up your \*AMP stack:
127-
* [Acquia Dev Desktop](template/readme/local-development.md#using-acquia-dev-desktop-for-blt-generated-projects)
128-
* [Drupal VM](template/readme/local-development.md#using-drupal-vm-for-blt-generated-projects)
129-
* [Other](https://github.com/acquia/blt/blob/8.x/template/readme/local-development.md#alternative-local-development-environments)
111+
112+
* [Acquia Dev Desktop](template/readme/local-development.md#using-acquia-dev-desktop-for-blt-generated-projects)
113+
* [Drupal VM](template/readme/local-development.md#using-drupal-vm-for-blt-generated-projects)
114+
* [Other](https://github.com/acquia/blt/blob/8.x/template/readme/local-development.md#alternative-local-development-environments)
130115

131116
When you have completed setting up your local \*AMP stack, double check that the following pieces of information are still correct:
132117

133118
* Local site DB credentials: `$databases` in docroot/sites/default/settings/local.settings.php
134119
* Local site URL: `$options[‘uri’]` in docroot/sites/default/local.drushrc.php
135120

136-
## <a name="install"></a>Build your project’s local dependencies and install Drupal locally
121+
## Build your project’s local dependencies and install Drupal locally
137122

138123
Run the following command from the project root: `blt local:setup`. This will do a lot of things for you, including:
139124

mkdocs.yml

+12-7
Original file line numberDiff line numberDiff line change
@@ -11,24 +11,29 @@ markdown_extensions:
1111
pages:
1212
- Home: 'index.md'
1313
- Overview: 'README.md'
14-
- Getting started: 'INSTALL.md'
14+
- Getting started:
15+
- Installation & upgrade: 'INSTALL.md'
1516
- Local development: 'template/readme/local-development.md'
16-
- Project documentation: 'template/README.md'
17+
- Project documentation:
18+
- Overview: 'template/README.md'
1719
- Developer:
1820
- Onboarding: 'template/readme/onboarding.md'
1921
- Repository architecture: 'template/readme/repo-architecture.md'
20-
- Running project tasks: 'template/readme/project-tasks.md'
22+
- Running project tasks:
23+
- Overview: 'template/readme/project-tasks.md'
2124
- Patches: 'template/patches/README.md'
22-
- Drush: 'template/drush/README.MD'
23-
- Git hooks: 'scripts/git-hook/README.md'
24-
- Best practices: 'template/readme/best-practices.md'
25+
- Drush: 'template/drush/README.md'
26+
- Git hooks: 'template/scripts/git-hooks/README.md'
27+
- Best practices:
28+
- Overview: 'template/readme/best-practices.md'
2529
- Views: 'template/readme/views.md'
2630
- Workflow: 'template/readme/dev-workflow.md'
2731
- Automated testing: 'template/tests/README.md'
2832
- Technical Architect:
2933
- Project architecture document: 'template/readme/architecture.md'
3034
- Deploying to cloud: 'template/readme/deploy.md'
31-
- Release process: 'template/readme/release-process.md'
35+
- Releases:
36+
- Release process: 'template/readme/release-process.md'
3237
- Release notes: 'scripts/release-notes/README.md'
3338
- Setting up continuous integration: 'template/readme/ci.md'
3439
- Open source contribution: 'template/readme/os-contribution.md'

template/readme/best-practices.md

+11-19
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,18 @@
44

55
_This document is a work in progress._ Unlinked items are planned topics, feel free to contribute.
66

7-
* [Standards](#standards)
8-
* [Exporting configuration](#exporting-config)
9-
* [Configuration updates](#config-updates)
10-
* [Caching strategies](#caching)
11-
* [Patching](#patching)
12-
* [Building Views](#views)
13-
* [Logging](#logging)
14-
* [Building content types](#content-types)
15-
16-
## <a name="standards"></a>Standards
7+
## Standards
178

189
All work must conform to established best practices and coding standards. Code quality is ensured in a variety of ways:
1910

20-
* All code must conform to [Drupal Coding Standards](https://www.drupal.org/coding-standards). This is enforced via [local git hooks](../scripts/git-hooks/README.md) and [code checks](../build/ performed during continuous integration.
11+
* All code must conform to [Drupal Coding Standards](https://www.drupal.org/coding-standards). This is enforced via [local git hooks](../scripts/git-hooks/README.md) and code checks performed during continuous integration.
2112
* All front end code must follow Drupal Theming Best Practices.
2213
* All code must be reviewed by a peer or established integrator before being merged into the master branch.
2314
* All new features must covered by an automated test that mirrors the ticket acceptance criteria.
2415

2516
Please peruse the [examples](examples) directory for examples of various coding best practices.
2617

27-
## <a name="exporting-config"></a>Exporting configuration
18+
## Exporting configuration
2819

2920
All site functionality should be represented in version-controlled code. This includes all configuration. Drupal configuration is typically exported via [Features](https://www.drupal.org/project/features).
3021

@@ -53,7 +44,7 @@ Common mistakes:
5344
* Each feature has too many dependencies, so no one feature can be used in isolation, or a single feature becomes impossible to disable. E.g., the "Workflow" feature depends on the "Press Room" feature because it requires field_body which is provided by "Press Room."
5445
* Features are too granular. E.g., there is a separate feature for each role, a feature contains only a single view, etc.
5546

56-
## <a name="config-updates"></a>Configuration updates
47+
## Configuration updates
5748

5849
* If a change is happening, that change needs to be documented in code, preferably an update hook. E.g.,
5950
* Reverting features and feature components `features_revert_module()`
@@ -62,7 +53,7 @@ Common mistakes:
6253
* Updates needs to be actively monitored. This should be done using NewRelic, SumoLogic, Logstreaming, and/or other monitoring tools.
6354
* Updates need to be intentional. E.g., don't use cloud hooks or cron jobs to automatically execute updates or clear caches.
6455

65-
## <a name="caching"></a>Caching
56+
## Caching
6657

6758
Without caching, Drupal is slow. As a general rule of thumb, _try to cache everything that you can_ and _try to invalidate that cache only when it is likely to be stale_.
6859

@@ -89,24 +80,25 @@ Specifically, ensure that you are properly caching data at every level possible,
8980

9081
See the [Drupal 8 Cache API](https://www.drupal.org/developing/api/8/cache) documentation for information in implementing your caching strategy.
9182

92-
## <a name="patching"></a>Patching
83+
## Patching
9384

9485
All modifications to contributed code should be performed via a patch. For detailed information on how to patch projects, please see [../patches/README.md]
9586
(../patches/README.md)
9687

97-
## <a name="views"></a>Views
88+
## Views
9889

9990
Please see [views.md](views.md).
10091

101-
## <a name="logging"></a>Logging
92+
## Logging
10293

103-
* Any configuration changes from custom modules should be logged to watchdog (also [Acquia Library recommendations|https://docs.acquia.com/articles/how-audit-authenticated-user-actions-better-risk-management])
94+
* Any configuration changes from custom modules should be logged to watchdog (also [Acquia Library recommendations](https://docs.acquia.com/articles/how-audit-authenticated-user-actions-better-risk-management)
10495
* Any destructive actions **must** be logged
10596

10697

107-
## <a name="content-types"></a>Building content types
98+
## Building content types
10899

109100
@todo Document:
101+
110102
* Appropriate time to use fields
111103
* Audit for overly complex content types
112104
* Reason: All fields loaded for each node load

template/readme/ci.md

+17-24
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## <a name="ci"></a> Continuous Integration
1+
## Continuous Integration
22

33
Integration with Travis CI is included, although Phing tasks can be used with any CI tool. The default Travis CI build process is as follows:
44

@@ -21,17 +21,15 @@ Automated testing of live content is easy to set up with two simple steps:
2121

2222
1. Add the hostname of your staging server to .travis.yml:
2323

24-
```
25-
ssh_known_hosts:
26-
- staging-12345.prod.hosting.acquia.com
27-
```
24+
ssh_known_hosts:
25+
- staging-12345.prod.hosting.acquia.com
26+
2827
2. Override the default `ci:build:validate:test` target by adding the following to `build/custom/phing/build.xml`:
2928

30-
```
31-
<!-- Override the core ci:build:validate:test target to include a local refresh-->
32-
<target name="ci:build:validate:test" description="Builds, validates, tests, and deploys an artifact."
33-
depends="validate:all, ci:setup, tests:security-updates, tests:phpunit, local:sync, local:update, tests:behat" />
34-
```
29+
<!-- Override the core ci:build:validate:test target to include a local refresh-->
30+
<target name="ci:build:validate:test" description="Builds, validates, tests, and deploys an artifact."
31+
depends="validate:all, ci:setup, tests:security-updates, tests:phpunit, local:sync, local:update, tests:behat" />
32+
3533

3634
### Setting Up Travis CI for automated deployments
3735

@@ -46,31 +44,26 @@ To set up this workflow, you must configure Acquia Cloud, GitHub, and Travis CI
4644

4745
1. Generate an SSH key locally. E.g.,
4846

49-
```
50-
cd ~/.ssh
51-
ssh-keygen -t rsa -b 4096
52-
```
47+
cd ~/.ssh
48+
ssh-keygen -t rsa -b 4096
5349

5450
Do not use a passphrase!
51+
5552
1. Create a new Acquia Cloud account to be used exclusively as a container for the SSH keys that will grant Travis push access to Acquia Cloud. This can be done by inviting a new team member on the "Teams" tab in Acquia Cloud. You can use an email address like `<email>[email protected]`. The team member must have SSH push access.
5653
1. Login the your new Acquia Cloud account and add the public SSH key from the key pair that was generated in step 1 by visiting `https://accounts.acquia.com/account/[uid]/security`.
5754
1. Add the same public SSH key to the "Deployment Keys" section on your project's GitHub settings page, located at `https://github.com/acquia-pso/[project-name]/settings/keys`.
5855
1. Add the _private SSH key_ to your project's Travis CI settings located at `https://magnum.travis-ci.com/acquia-pso/[project-name]/settings`.
5956
1. Uncomment the example deployment steps in your .travis.yml file and customize them to deploy your desired branch.
6057
1. Add your cloud git repository to the remotes section of your project.yml file:
61-
62-
```
63-
remotes:
64-
- [email protected]:example.git`
65-
```
58+
59+
remotes:
60+
- [email protected]:example.git`
6661

6762
1. Add your cloud git repository's server host name to `ssh_known_hosts` in your .travis.yml file.
6863

69-
```
70-
addons:
71-
ssh_known_hosts:
72-
- svn-14671.prod.hosting.acquia.com
73-
```
64+
addons:
65+
ssh_known_hosts:
66+
- svn-14671.prod.hosting.acquia.com
7467

7568
1. Commits or merges to the develop branch on GitHub should now trigger a fully built artifact to be deployed to your specified remotes.
7669

template/readme/deploy.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ This task is analogous to `setup:build` but with a few critical differences:
3333

3434
After the artifact is created, you can inspect it or even run it as a website locally. You may also manually commit and push it to ACE.
3535

36-
## <a name="build-artifact"></a>Create and deploy the build artifact
36+
## Create and deploy the build artifact
3737

3838
To both create and deploy the build artifact in a single command, run the following command
3939

0 commit comments

Comments
 (0)