Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove README content from review app #482

Merged
merged 5 commits into from
Feb 15, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ Internal:
(PR [#427](https://github.com/alphagov/govuk-frontend/pull/427))
- Improve documentation around publishing (PR [#430](https://github.com/alphagov/govuk-frontend/pull/430))
- Improve documentation around contributing (PR [#433](https://github.com/alphagov/govuk-frontend/pull/433))
- Remove readme content from review app (PR [#482](https://github.com/alphagov/govuk-frontend/pull/482))

## 0.0.21-alpha (Breaking release)
Skipped 0.0.20-alpha due to difficulties with publishing.
Expand Down
110 changes: 2 additions & 108 deletions app/views/layouts/component.njk
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{% set componentName = componentPath %}
{% extends "layout-debug.njk" %}

{% block content %}
Expand All @@ -9,7 +10,6 @@
{% include componentName +"/"+ componentName +".njk" ignore missing %}
{% endset %}

{% if not isReadme %}
{% from "breadcrumbs/macro.njk" import govukBreadcrumbs %}

{{ govukBreadcrumbs({
Expand All @@ -19,121 +19,15 @@
]
}) }}
<div class="govuk-o-main-wrapper">
{% endif %}
<h1 class="govuk-heading-xl">
{% block componentName %}
{{ componentName | replace("-", " ") | capitalize }}
{{ componentNameHuman }}
{% endblock %}
</h1>

{% if isReadme %}
<h2 class="govuk-heading-l">Introduction</h2>
{% endif %}
<p class="govuk-body-lead">
{% block componentDescription %}
{% endblock %}
</p>

{% if componentGuidanceLink %}
<h2 class="govuk-heading-l">Guidance</h2>
<p class="govuk-body">
Find out when to use the {{ componentNameHuman }} component in your service in the <a href="{{- componentGuidanceLink -}}" class="govuk-link">GOV.UK Design System</a>.
</p>
{% endif %}

{% if isReadme %}
<h2 class="govuk-heading-l">Quick start examples</h2>
<p class="govuk-body">{% block componentHtmlUsageWriteup %}{% endblock %}</p>
{% endif %}

{% from "showExamples.njk" import showExamples %}
{% block examples %}
{{ showExamples(componentName, componentData) }}
{% endblock %}

{% if isReadme %}
<h2 class="govuk-heading-l">Dependencies</h2>

<p class="govuk-body">To consume the {{ componentName }} component you must be running npm version 5 or above. </p>

<p class="govuk-body">{% block componentDependencies %}{% endblock %}</p>

<h2 class="govuk-heading-l">Installation</h2>

<pre><code>
npm install --save @govuk-frontend/{{ componentName }}
</code></pre>

<h2 class="govuk-heading-l">Requirements</h2>
<h3 class="govuk-heading-m">Build tool configuration</h3>
<p class="govuk-body">When compiling the Sass files you'll need to define includePaths to reference the node_modules directory. Below is a sample configuration using gulp</p>
<pre><code>
.pipe(sass({
includePaths: 'node_modules/'
}))
</code></pre>


<h3 class="govuk-heading-m">Static asset path configuration</h3>
<p class="govuk-body">To show the button image you need to configure your app to show these assets. Below is a sample configuration using Express js:</p>

<pre><code>
app.use('/public', express.static(path.join(__dirname, '/node_modules/@govuk-frontend/icons')))
</code></pre>
{% endif %}

<h2 class="govuk-heading-l">Component arguments</h2>
<p class="govuk-body">If you are using Nunjucks,then macros take the following arguments</p>

{% from "table/macro.njk" import govukTable %}
{% block componentArguments %}
{% endblock %}

{% if isReadme %}
<h3 class="govuk-heading-m">Setting up Nunjucks views and paths</h3>
<p class="govuk-body">Below is an example setup using express configure views:</p>

<pre><code>
nunjucks.configure('node_modules/@govuk-frontend', {
autoescape: true,
cache: false,
express: app
})
</code></pre>

<h2 class="govuk-heading-l">Getting updates</h2>

<p class="govuk-body">To check whether you have the latest version of the button run:</p>

<pre><code>
npm outdated @govuk-frontend/{{ componentName }}
</code></pre>

<p class="govuk-body">To update the latest version run:</p>

<pre><code>
npm update @govuk-frontend/{{ componentName }}
</code></pre>

<h2 class="govuk-heading-l">Contribution</h2>
<p class="govuk-body">
Guidelines can be found at <a href="https://github.com/alphagov/govuk-frontend/blob/master/CONTRIBUTING.md" title="link to contributing guidelines on our github repository" class="govuk-link">on our Github repository.</a>
</p>

<h2 class="govuk-heading-l">License</h2>
<p class="govuk-body">MIT</p>
{% endif %}

{% if not isReadme %}
<h2 class="govuk-heading-l">Installation and setup</h2>
<p class="govuk-body">
<a href="https://github.com/alphagov/govuk-frontend/tree/master/src/components/{{ componentName}}" class="govuk-link">
View the {{ componentName }} README on GitHub
</a>
</p>

</div>

{% endif %}

{% endblock %}
96 changes: 96 additions & 0 deletions app/views/layouts/readme.njk
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
{% set componentName = componentPath %}
{% set componentNameHuman = componentName | replace("-", " ") | capitalize %}
{% set componentGuidanceLink = componentGuidanceLink | default('https://govuk-design-system-production.cloudapps.digital/components/' + componentName)%}
<h1>
{% block componentName %}
{{ componentNameHuman }}
{% endblock %}
</h1>

<h2>Introduction</h2>
{% block componentDescription %}
{% endblock %}

{% if componentGuidanceLink %}
<h2>Guidance</h2>
<p>
Find out when to use the {{ componentNameHuman }} component in your service in the <a href="{{- componentGuidanceLink -}}" class="govuk-link">GOV.UK Design System</a>.
</p>
{% endif %}

<h2>Quick start examples</h2>
<p>{% block componentHtmlUsageWriteup %}{% endblock %}</p>

{% from "showExamples.njk" import showExamples %}
{% block examples %}
{{ showExamples(componentName, componentData) }}
{% endblock %}

<h2>Dependencies</h2>

<p>To consume the {{ componentName }} component you must be running npm version 5 or above. </p>

<p>{% block componentDependencies %}{% endblock %}</p>

<h2>Installation</h2>

<pre><code>
npm install --save @govuk-frontend/{{ componentName }}
</code></pre>

<h2>Requirements</h2>
<h3>Build tool configuration</h3>
<p>When compiling the Sass files you'll need to define includePaths to reference the node_modules directory. Below is a sample configuration using gulp</p>
<pre><code>
.pipe(sass({
includePaths: 'node_modules/'
}))
</code></pre>


<h3>Static asset path configuration</h3>
<p>To show the button image you need to configure your app to show these assets. Below is a sample configuration using Express js:</p>

<pre><code>
app.use('/public', express.static(path.join(__dirname, '/node_modules/@govuk-frontend/icons')))
</code></pre>

<h2>Component arguments</h2>
<p>If you are using Nunjucks,then macros take the following arguments</p>

{% from "table/macro.njk" import govukTable %}
{% block componentArguments %}
{% endblock %}

<h3>Setting up Nunjucks views and paths</h3>
<p>Below is an example setup using express configure views:</p>

<pre><code>
nunjucks.configure('node_modules/@govuk-frontend', {
autoescape: true,
cache: false,
express: app
})
</code></pre>

<h2>Getting updates</h2>

<p>To check whether you have the latest version of the button run:</p>

<pre><code>
npm outdated @govuk-frontend/{{ componentName }}
</code></pre>

<p>To update the latest version run:</p>

<pre><code>
npm update @govuk-frontend/{{ componentName }}
</code></pre>

<h2>Contribution</h2>
<p>
Guidelines can be found at <a href="https://github.com/alphagov/govuk-frontend/blob/master/CONTRIBUTING.md" title="link to contributing guidelines on our github repository" class="govuk-link">on our Github repository.</a>
</p>

<h2>License</h2>
<p>MIT</p>
24 changes: 12 additions & 12 deletions src/components/back-link/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,23 +31,23 @@ To consume the back-link component you must be running npm version 5 or above.

## Installation

npm install --save @govuk-frontend/back-link
npm install --save @govuk-frontend/back-link

## Requirements

### Build tool configuration

When compiling the Sass files you'll need to define includePaths to reference the node_modules directory. Below is a sample configuration using gulp

.pipe(sass({
includePaths: 'node_modules/'
}))
.pipe(sass({
includePaths: 'node_modules/'
}))

### Static asset path configuration

To show the button image you need to configure your app to show these assets. Below is a sample configuration using Express js:

app.use('/public', express.static(path.join(__dirname, '/node_modules/@govuk-frontend/icons')))
app.use('/public', express.static(path.join(__dirname, '/node_modules/@govuk-frontend/icons')))

## Component arguments

Expand Down Expand Up @@ -141,21 +141,21 @@ If you are using Nunjucks,then macros take the following arguments

Below is an example setup using express configure views:

nunjucks.configure('node_modules/@govuk-frontend', {
autoescape: true,
cache: false,
express: app
})
nunjucks.configure('node_modules/@govuk-frontend', {
autoescape: true,
cache: false,
express: app
})

## Getting updates

To check whether you have the latest version of the button run:

npm outdated @govuk-frontend/back-link
npm outdated @govuk-frontend/back-link

To update the latest version run:

npm update @govuk-frontend/back-link
npm update @govuk-frontend/back-link

## Contribution

Expand Down
8 changes: 7 additions & 1 deletion src/components/back-link/index.njk
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
{% extends "component.njk" %}
{% if isReadme %}
{% set parentTemplate = "readme.njk" %}
{% else %}
{% set parentTemplate = "component.njk" %}
{% endif %}

{% extends parentTemplate %}

{# Commented out blocks below inherit from views/component.njk #}

Expand Down
24 changes: 12 additions & 12 deletions src/components/breadcrumbs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -206,23 +206,23 @@ Please note, this component depends on @govuk-frontend/globals and @govuk-fronte

## Installation

npm install --save @govuk-frontend/breadcrumbs
npm install --save @govuk-frontend/breadcrumbs

## Requirements

### Build tool configuration

When compiling the Sass files you'll need to define includePaths to reference the node_modules directory. Below is a sample configuration using gulp

.pipe(sass({
includePaths: 'node_modules/'
}))
.pipe(sass({
includePaths: 'node_modules/'
}))

### Static asset path configuration

To show the button image you need to configure your app to show these assets. Below is a sample configuration using Express js:

app.use('/public', express.static(path.join(__dirname, '/node_modules/@govuk-frontend/icons')))
app.use('/public', express.static(path.join(__dirname, '/node_modules/@govuk-frontend/icons')))

## Component arguments

Expand Down Expand Up @@ -328,21 +328,21 @@ If you are using Nunjucks,then macros take the following arguments

Below is an example setup using express configure views:

nunjucks.configure('node_modules/@govuk-frontend', {
autoescape: true,
cache: false,
express: app
})
nunjucks.configure('node_modules/@govuk-frontend', {
autoescape: true,
cache: false,
express: app
})

## Getting updates

To check whether you have the latest version of the button run:

npm outdated @govuk-frontend/breadcrumbs
npm outdated @govuk-frontend/breadcrumbs

To update the latest version run:

npm update @govuk-frontend/breadcrumbs
npm update @govuk-frontend/breadcrumbs

## Contribution

Expand Down
8 changes: 7 additions & 1 deletion src/components/breadcrumbs/index.njk
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
{% extends "component.njk" %}
{% if isReadme %}
{% set parentTemplate = "readme.njk" %}
{% else %}
{% set parentTemplate = "component.njk" %}
{% endif %}

{% extends parentTemplate %}

{# Commented out blocks below inherit from views/component.njk #}

Expand Down
Loading