Skip to content

Commit

Permalink
Merge pull request #141 from PHPCSStandards/docs-site/convert-to-usin…
Browse files Browse the repository at this point in the history
…g-ghpages-jekyll

Docs website: convert to using Jekyll
  • Loading branch information
jrfnl authored May 30, 2020
2 parents ec02431 + a44db1a commit c4a63d9
Show file tree
Hide file tree
Showing 33 changed files with 430 additions and 1,897 deletions.
22 changes: 22 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
os: linux
dist: trusty

language: php
Expand All @@ -10,6 +11,7 @@ cache:
- $HOME/.composer/cache/files
# Cache directory for more recent Composer versions.
- $HOME/.cache/composer/files
- /home/travis/.rvm/

php:
- 5.5
Expand All @@ -31,6 +33,8 @@ env:
# See: https://docs.travis-ci.com/user/conditions-v1
stages:
- name: sniff
- name: docs
if: branch IN (master)
- name: quicktest
if: type = push AND branch NOT IN (master, develop)
- name: test
Expand Down Expand Up @@ -66,6 +70,24 @@ jobs:
# Check the code-style consistency of the xml files.
- diff -B ./PHPCSUtils/ruleset.xml <(xmllint --format "./PHPCSUtils/ruleset.xml")
- diff -B ./PHPCS23Utils/ruleset.xml <(xmllint --format "./PHPCS23Utils/ruleset.xml")
after_success: skip

#### DOCUMENTATION SITE TESTING STAGE ####
- stage: docs
language: ruby
cache: bundler
rvm:
- 2.5.8
before_install: skip
install:
- cd ./docs
- gem install bundler
- bundle install
before_script: skip
script:
# Test the documentation generation.
- bundle exec jekyll build
after_success: skip

#### QUICK TEST STAGE ####
# This is a much quicker test which only runs the unit tests and linting against the low/high
Expand Down
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,12 @@ PHPCSUtils: A suite of utility functions for use with PHP_CodeSniffer
Features
-------------------------------------------

This is a set of utilities to aid developers of sniffs for [PHP_CodeSniffer](https://github.com/squizlabs/PHP_CodeSniffer).
[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).

This package offers the following features:

<div id="feature-list">

### Use the latest version of PHP_CodeSniffer native utility functions.

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.
Expand Down Expand Up @@ -71,6 +73,7 @@ A `PHPCS23Utils` standard which allows sniffs to work in both PHPCS 2.x and 3.x,

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/).

</div>

Minimum Requirements
-------------------------------------------
Expand Down Expand Up @@ -216,6 +219,8 @@ Once that's done, you will need to make a small tweak to your own dev environmen
Frequently Asked Questions
-------
<div id="faq">
#### Q: How does this all work without an external standard needing to register an autoloader?
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.
Expand All @@ -232,6 +237,7 @@ A: The backfill for PHP 7.4 numeric literals with underscores in PHP_CodeSniffer
The backfill was fixed in PHP_CodeSniffer 3.5.4.
</div>
Contributing
-------
Expand All @@ -241,4 +247,4 @@ If you are unsure whether the changes you are proposing would be welcome, please
License
-------
This code is released under the GNU Lesser General Public License (LGPLv3). For more information, visit http://www.gnu.org/copyleft/lesser.html
This code is released under the [GNU Lesser General Public License (LGPLv3)](http://www.gnu.org/copyleft/lesser.html).
4 changes: 4 additions & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
_site/*
Gemfile.lock
.sass-cache
*.gem
5 changes: 5 additions & 0 deletions docs/Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
source 'https://rubygems.org'

gem "github-pages", group: :jekyll_plugins do
gem 'jekyll-commonmark-ghpages'
end
36 changes: 36 additions & 0 deletions docs/_config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
baseurl: /
highlighter: rouge
markdown: CommonMarkGhPages
encoding: UTF-8
theme: jekyll-theme-minimal
repository: "PHPCSStandards/PHPCSUtils"
github: [metadata]
url: "https://phpcsutils.com"

plugins:
- jekyll-github-metadata
- jemoji
- jekyll-mentions
- jekyll-seo-tag
- jekyll-sitemap

phpcsutils:
packagist: phpcsstandards/phpcsutils

# Theme info.
title: PHPCSUtils
description: "A suite of utility functions for use with PHP_CodeSniffer."
logo:
show_downloads: false
google_analytics:

# SEO info.
tagline: "PHPCSUtils: A suite of utility functions for use with PHP_CodeSniffer."
twitter:
username: jrf_nl
card: summary
hashtags: PHPCSUtils
author:
twitter: jrf_nl

exclude: ['CNAME', '.gitignore', 'Gemfile', '*.bak', '*.orig']
79 changes: 79 additions & 0 deletions docs/_layouts/default.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
<!DOCTYPE html>
<html lang="{{ site.lang | default: "en-US" }}">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">

{% seo %}
<link rel="stylesheet" href="{{ "/assets/css/style.css?v=" | append: site.github.build_revision | relative_url }}">
<link rel="stylesheet" href="{{ "/assets/css/syntax.css?v=" | append: site.github.build_revision | relative_url }}">
<!--[if lt IE 9]>
<script src="https://cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv.min.js"></script>
<![endif]-->
</head>
<body>
<div class="wrapper">
<header>
<h1><a href="{{ "/" | absolute_url }}">{{ site.title | default: site.github.repository_name }}</a></h1>

{% if site.logo %}
<img src="{{site.logo | absolute_url }}" alt="Logo" />
{% endif %}

<p>{{ site.description | default: site.github.project_tagline }}</p>

{% if site.github.is_project_page %}
<p class="view"><a href="{{ site.github.repository_url }}">Visit the Project on GitHub <small>{{ site.github.repository_nwo }}</small></a></p>
{% endif %}

<p class="docs"><a href="{{ "/phpdoc/index.html" | absolute_url }}">Read the Documentation</a></p>

<div class="install">
<a href="https://packagist.org/packages/{{ site.phpcsutils.packagist }}">Install using Composer:</a><br>
<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>
</div>

{% if site.show_downloads %}
<ul class="downloads">
<li><a href="{{ site.github.zip_url }}">Download <strong>ZIP File</strong></a></li>
<li><a href="{{ site.github.tar_url }}">Download <strong>TAR Ball</strong></a></li>
<li><a href="{{ site.github.repository_url }}">View On <strong>GitHub</strong></a></li>
</ul>
{% endif %}

<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>

</header>

</header>
<section>

{{ content }}

</section>
<footer>
{% if site.github.is_project_page %}
<p>This project is maintained by <a href="{{ site.github.owner_url }}">{{ site.github.owner_name }}</a></p>
{% endif %}
<p><small>Hosted on GitHub Pages &mdash; Theme by <a href="https://github.com/orderedlist">orderedlist</a></small></p>
</footer>
</div>

<script src="{{ "/assets/js/scale.fix.js" | relative_url }}"></script>
{% if site.google_analytics %}
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
ga('create', '{{ site.google_analytics }}', 'auto');
ga('send', 'pageview');
</script>
{% endif %}

<script type="text/javascript">
!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');
</script>
</body>
</html>
Loading

0 comments on commit c4a63d9

Please sign in to comment.