Skip to content

Commit c4a63d9

Browse files
authored
Merge pull request #141 from PHPCSStandards/docs-site/convert-to-using-ghpages-jekyll
Docs website: convert to using Jekyll
2 parents ec02431 + a44db1a commit c4a63d9

33 files changed

+430
-1897
lines changed

.travis.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
os: linux
12
dist: trusty
23

34
language: php
@@ -10,6 +11,7 @@ cache:
1011
- $HOME/.composer/cache/files
1112
# Cache directory for more recent Composer versions.
1213
- $HOME/.cache/composer/files
14+
- /home/travis/.rvm/
1315

1416
php:
1517
- 5.5
@@ -31,6 +33,8 @@ env:
3133
# See: https://docs.travis-ci.com/user/conditions-v1
3234
stages:
3335
- name: sniff
36+
- name: docs
37+
if: branch IN (master)
3438
- name: quicktest
3539
if: type = push AND branch NOT IN (master, develop)
3640
- name: test
@@ -66,6 +70,24 @@ jobs:
6670
# Check the code-style consistency of the xml files.
6771
- diff -B ./PHPCSUtils/ruleset.xml <(xmllint --format "./PHPCSUtils/ruleset.xml")
6872
- diff -B ./PHPCS23Utils/ruleset.xml <(xmllint --format "./PHPCS23Utils/ruleset.xml")
73+
after_success: skip
74+
75+
#### DOCUMENTATION SITE TESTING STAGE ####
76+
- stage: docs
77+
language: ruby
78+
cache: bundler
79+
rvm:
80+
- 2.5.8
81+
before_install: skip
82+
install:
83+
- cd ./docs
84+
- gem install bundler
85+
- bundle install
86+
before_script: skip
87+
script:
88+
# Test the documentation generation.
89+
- bundle exec jekyll build
90+
after_success: skip
6991

7092
#### QUICK TEST STAGE ####
7193
# This is a much quicker test which only runs the unit tests and linting against the low/high

README.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,12 @@ PHPCSUtils: A suite of utility functions for use with PHP_CodeSniffer
3131
Features
3232
-------------------------------------------
3333

34-
This is a set of utilities to aid developers of sniffs for [PHP_CodeSniffer](https://github.com/squizlabs/PHP_CodeSniffer).
34+
[PHPCSUtils](https://github.com/PHPCSStandards/PHPCSUtils) is a set of utilities to aid developers of sniffs for [PHP_CodeSniffer](https://github.com/squizlabs/PHP_CodeSniffer).
3535

3636
This package offers the following features:
3737

38+
<div id="feature-list">
39+
3840
### Use the latest version of PHP_CodeSniffer native utility functions.
3941

4042
Normally to use the latest version of PHP_CodeSniffer native utility functions, you would have to raise the minimum requirements of your external PHPCS standard.
@@ -71,6 +73,7 @@ A `PHPCS23Utils` standard which allows sniffs to work in both PHPCS 2.x and 3.x,
7173

7274
To see detailed information about all the available abstract sniffs, utility functions and PHPCS helper functions, have a read through the [extensive documentation](https://phpcsutils.com/).
7375

76+
</div>
7477

7578
Minimum Requirements
7679
-------------------------------------------
@@ -216,6 +219,8 @@ Once that's done, you will need to make a small tweak to your own dev environmen
216219
Frequently Asked Questions
217220
-------
218221
222+
<div id="faq">
223+
219224
#### Q: How does this all work without an external standard needing to register an autoloader?
220225
221226
A: As PHPCSUtils is registered with PHPCS as an external standard and PHPCSUtils complies with the naming requirements of PHPCS, the PHPCS native autoloader will automatically take care of loading the classes you use from PHPCSUtils.
@@ -232,6 +237,7 @@ A: The backfill for PHP 7.4 numeric literals with underscores in PHP_CodeSniffer
232237
233238
The backfill was fixed in PHP_CodeSniffer 3.5.4.
234239
240+
</div>
235241
236242
Contributing
237243
-------
@@ -241,4 +247,4 @@ If you are unsure whether the changes you are proposing would be welcome, please
241247
242248
License
243249
-------
244-
This code is released under the GNU Lesser General Public License (LGPLv3). For more information, visit http://www.gnu.org/copyleft/lesser.html
250+
This code is released under the [GNU Lesser General Public License (LGPLv3)](http://www.gnu.org/copyleft/lesser.html).

docs/.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
_site/*
2+
Gemfile.lock
3+
.sass-cache
4+
*.gem

docs/Gemfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
source 'https://rubygems.org'
2+
3+
gem "github-pages", group: :jekyll_plugins do
4+
gem 'jekyll-commonmark-ghpages'
5+
end

docs/_config.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
baseurl: /
2+
highlighter: rouge
3+
markdown: CommonMarkGhPages
4+
encoding: UTF-8
5+
theme: jekyll-theme-minimal
6+
repository: "PHPCSStandards/PHPCSUtils"
7+
github: [metadata]
8+
url: "https://phpcsutils.com"
9+
10+
plugins:
11+
- jekyll-github-metadata
12+
- jemoji
13+
- jekyll-mentions
14+
- jekyll-seo-tag
15+
- jekyll-sitemap
16+
17+
phpcsutils:
18+
packagist: phpcsstandards/phpcsutils
19+
20+
# Theme info.
21+
title: PHPCSUtils
22+
description: "A suite of utility functions for use with PHP_CodeSniffer."
23+
logo:
24+
show_downloads: false
25+
google_analytics:
26+
27+
# SEO info.
28+
tagline: "PHPCSUtils: A suite of utility functions for use with PHP_CodeSniffer."
29+
twitter:
30+
username: jrf_nl
31+
card: summary
32+
hashtags: PHPCSUtils
33+
author:
34+
twitter: jrf_nl
35+
36+
exclude: ['CNAME', '.gitignore', 'Gemfile', '*.bak', '*.orig']

docs/_layouts/default.html

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
<!DOCTYPE html>
2+
<html lang="{{ site.lang | default: "en-US" }}">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
6+
<meta name="viewport" content="width=device-width, initial-scale=1">
7+
8+
{% seo %}
9+
<link rel="stylesheet" href="{{ "/assets/css/style.css?v=" | append: site.github.build_revision | relative_url }}">
10+
<link rel="stylesheet" href="{{ "/assets/css/syntax.css?v=" | append: site.github.build_revision | relative_url }}">
11+
<!--[if lt IE 9]>
12+
<script src="https://cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv.min.js"></script>
13+
<![endif]-->
14+
</head>
15+
<body>
16+
<div class="wrapper">
17+
<header>
18+
<h1><a href="{{ "/" | absolute_url }}">{{ site.title | default: site.github.repository_name }}</a></h1>
19+
20+
{% if site.logo %}
21+
<img src="{{site.logo | absolute_url }}" alt="Logo" />
22+
{% endif %}
23+
24+
<p>{{ site.description | default: site.github.project_tagline }}</p>
25+
26+
{% if site.github.is_project_page %}
27+
<p class="view"><a href="{{ site.github.repository_url }}">Visit the Project on GitHub <small>{{ site.github.repository_nwo }}</small></a></p>
28+
{% endif %}
29+
30+
<p class="docs"><a href="{{ "/phpdoc/index.html" | absolute_url }}">Read the Documentation</a></p>
31+
32+
<div class="install">
33+
<a href="https://packagist.org/packages/{{ site.phpcsutils.packagist }}">Install using Composer:</a><br>
34+
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>composer require <span class="s">{{ site.phpcsutils.packagist }}</span></code></pre></div></div>
35+
</div>
36+
37+
{% if site.show_downloads %}
38+
<ul class="downloads">
39+
<li><a href="{{ site.github.zip_url }}">Download <strong>ZIP File</strong></a></li>
40+
<li><a href="{{ site.github.tar_url }}">Download <strong>TAR Ball</strong></a></li>
41+
<li><a href="{{ site.github.repository_url }}">View On <strong>GitHub</strong></a></li>
42+
</ul>
43+
{% endif %}
44+
45+
<p><a href="https://twitter.com/share" class="twitter-share-button" data-related="{{ site.twitter.username }}" data-count="none" data-hashtags="{{ site.twitter.hashtags }}">Tweet about it</a></p>
46+
47+
</header>
48+
49+
</header>
50+
<section>
51+
52+
{{ content }}
53+
54+
</section>
55+
<footer>
56+
{% if site.github.is_project_page %}
57+
<p>This project is maintained by <a href="{{ site.github.owner_url }}">{{ site.github.owner_name }}</a></p>
58+
{% endif %}
59+
<p><small>Hosted on GitHub Pages &mdash; Theme by <a href="https://github.com/orderedlist">orderedlist</a></small></p>
60+
</footer>
61+
</div>
62+
63+
<script src="{{ "/assets/js/scale.fix.js" | relative_url }}"></script>
64+
{% if site.google_analytics %}
65+
<script>
66+
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
67+
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
68+
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
69+
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
70+
ga('create', '{{ site.google_analytics }}', 'auto');
71+
ga('send', 'pageview');
72+
</script>
73+
{% endif %}
74+
75+
<script type="text/javascript">
76+
!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');
77+
</script>
78+
</body>
79+
</html>

0 commit comments

Comments
 (0)