Browse Source

Started theming the docs

split-manual
Dustin Wilson 3 years ago
parent
commit
26444ee896
  1. 1
      .gitignore
  2. 24
      RoboFile.php
  3. 2
      docs/config.json
  4. 2
      docs/en/030_Document_Object_Model/010_Comment.md
  5. 4
      docs/en/030_Document_Object_Model/010_Document/index.md
  6. 2
      docs/en/030_Document_Object_Model/010_Element/index.md
  7. 9
      docs/theme/php/config.json
  8. 2
      docs/theme/php/daux.min.js
  9. 2
      docs/theme/php/php.css
  10. 334
      docs/theme/src/php.scss
  11. 17
      package.json
  12. 17
      postcss.config.js
  13. 1158
      yarn.lock

1
.gitignore

@ -1,5 +1,6 @@
# html5-parser specific
manual
node_modules
test*.php
# General

24
RoboFile.php

@ -38,6 +38,30 @@ class RoboFile extends \Robo\Tasks {
return $this->taskExec($execpath)->arg("serve")->args($args)->run();
}
/** Rebuilds the entire manual theme
*
* This requires Node and Yarn to be installed, and only needs to be done when
* Daux's theme changes
*/
public function manualTheme(array $args): Result {
$postcss = escapeshellarg(norm(BASE."node_modules/.bin/postcss"));
$themesrc = norm(BASE."docs/theme/src/").\DIRECTORY_SEPARATOR;
$themeout = norm(BASE."docs/theme/php/").\DIRECTORY_SEPARATOR;
$dauxjs = norm(BASE."vendor/daux/vendor/daux/daux.io/themes/daux/js/").\DIRECTORY_SEPARATOR;
// start a collection; this stops after the first failure
$t = $this->collectionBuilder();
// install dependencies via Yarn
$t->taskExec("yarn install");
// compile the stylesheet
$t->taskExec($postcss)->arg($themesrc."php.scss")->option("-o", $themeout."php.css");
// copy JavaScript files from the Daux theme
foreach (glob($dauxjs."daux*.js") as $file) {
$t->taskFilesystemStack()->copy($file, $themeout.basename($file), true);
}
// execute the collection
return $t->run();
}
/** Runs the typical test suite
*
* Arguments passed to the task are passed on to PHPUnit. Thus one may, for

2
docs/config.json

@ -5,7 +5,9 @@
"languages": {
"en": "English"
},
"themes_directory": "docs/theme",
"html": {
"theme":"php",
"float": false,
"toggle_code": false,
"search": false

2
docs/en/030_Document_Object_Model/010_Comment.md

@ -6,7 +6,7 @@ title: Comment
## Introduction ##
<div class="info"><p><strong>Info</strong> Only new methods and methods which make outward-facing changes from <a href="https://www.php.net/manual/en/class.domcomment.php">\DOMComment</a> will be documented here, otherwise they will be linked back to PHP's documentation.</p></div>
<div class="admonition info"><p><strong>Info</strong> Only new methods and methods which make outward-facing changes from <a href="https://www.php.net/manual/en/class.domcomment.php">\DOMComment</a> will be documented here, otherwise they will be linked back to PHP's documentation.</p></div>
## Class Synopsis ##

4
docs/en/030_Document_Object_Model/010_Document/index.md

@ -8,7 +8,7 @@ title: Document
Represents an entire HTML document; serves as the root of the document tree. Unlike the PHP [`\DOMDocument`](https://www.php.net/manual/en/class.domdocument.php) class in which it inherits from it cannot be used to represent an XML document. It is strictly used to represent HTML.
<div class="info"><p><strong>Info</strong> Only new methods and methods which make outward-facing changes from <a href="https://www.php.net/manual/en/class.domdocument.php">\DOMDocument</a> will be documented here, otherwise they will be linked back to PHP's documentation.</p></div>
<div class="admonition info"><p><strong>Info</strong> Only new methods and methods which make outward-facing changes from <a href="https://www.php.net/manual/en/class.domdocument.php">\DOMDocument</a> will be documented here, otherwise they will be linked back to PHP's documentation.</p></div>
## Class Synopsis ##
@ -22,7 +22,7 @@ Represents an entire HTML document; serves as the root of the document tree. Unl
public const LIMITED_QUIRKS_MODE = 2 ;
/* Properties */
public Element|null <a href="#document-props-body">$body</a> = null ;
public <a href="../Element/index.html">Element</a>|null <a href="#document-props-body">$body</a> = null ;
public string|null <a href="#document-props-documentencoding">$documentEncoding</a> = null ;
public int <a href="#document-props-quirksmode">$quirksMode</a> = 0 ;

2
docs/en/030_Document_Object_Model/010_Element/index.md

@ -6,7 +6,7 @@ title: Element
## Introduction ##
<div class="info"><p><strong>Info</strong> Only new methods and methods which make outward-facing changes from <a href="https://www.php.net/manual/en/class.domelement.php">\DOMElement</a> will be documented here, otherwise they will be linked back to PHP's documentation.</p></div>
<div class="admonition info"><p><strong>Info</strong> Only new methods and methods which make outward-facing changes from <a href="https://www.php.net/manual/en/class.domelement.php">\DOMElement</a> will be documented here, otherwise they will be linked back to PHP's documentation.</p></div>
## Class Synopsis ##

9
docs/theme/php/config.json

@ -0,0 +1,9 @@
{
"favicon": "<theme_url>favicon.png",
"js": [
"<theme_url>daux.min.js"
],
"css": [
"<theme_url>php.css"
]
}

2
docs/theme/php/daux.min.js

@ -0,0 +1,2 @@
var e=document.querySelectorAll(".s-content pre"),t=document.querySelector(".CodeToggler"),n="daux_code_blocks_hidden";function a(t){for(var a=0;a<e.length;a++)e[a].classList.toggle("Hidden",t);try{localStorage.setItem(n,t)}catch(e){}}t&&(e.length?function(){var e=t.querySelector(".CodeToggler__button--main");e.addEventListener("change",(function(e){a(!e.target.checked)}),!1);var r=!1;try{"false"===(r=localStorage.getItem(n))?r=!1:"true"===r&&(r=!0),r&&(a(!!r),e.checked=!r)}catch(e){}}():t.classList.add("Hidden"));var r=document.querySelector(".Collapsible__trigger");if(r){var o=document.querySelector(".Collapsible__content");r.addEventListener("click",(function(e){o.classList.contains("Collapsible__content--open")?(o.style.height=0,o.classList.remove("Collapsible__content--open"),r.setAttribute("aria-expanded","false")):(r.setAttribute("aria-expanded","true"),o.style.transitionDuration="150ms",o.style.height="".concat(o.scrollHeight,"px"),o.classList.add("Collapsible__content--open"))}))}var l=document.querySelectorAll("pre > code:not(.hljs)");if(l.length){var i=document.getElementsByTagName("head")[0],c=document.createElement("script");c.type="text/javascript",c.async=!0,c.src="".concat(window.base_url,"daux_libraries/highlight.pack.js"),c.onload=function(e){[].forEach.call(l,window.hljs.highlightBlock)},i.appendChild(c)}function s(e){var t=void 0!==e.preventDefault;t&&e.preventDefault();var n=function(e){for(var t=e;(t=t.parentNode)&&9!==t.nodeType;)if(1===t.nodeType&&t.classList.contains("Nav__item"))return t;throw new Error("Could not find a NavItem...")}(e.target),a=n.querySelector("ul.Nav");t&&n.classList.contains("Nav__item--open")?(a.style.height="".concat(a.scrollHeight,"px"),a.style.transitionDuration="150ms",a.style.height="0px",n.classList.remove("Nav__item--open")):t?(a.style.transitionDuration="150ms",a.addEventListener("transitionend",(function e(t){"0px"!==t.target.style.height&&(t.target.style.height="auto"),t.target.removeEventListener("transitionend",e)})),a.style.height="".concat(a.scrollHeight,"px"),n.classList.add("Nav__item--open")):a.style.height="auto"}for(var d,u=document.querySelectorAll(".Nav__item.has-children i.Nav__arrow"),h=u.length-1;h>=0;h--)(d=u[h]).addEventListener("click",s),d.parentNode.parentNode.classList.contains("Nav__item--open")&&s({target:d});var g=document.querySelectorAll(".Nav__item__link--nopage"),v=!0,p=!1,_=void 0;try{for(var y,m=g[Symbol.iterator]();!(v=(y=m.next()).done);v=!0){y.value.addEventListener("click",s)}}catch(e){p=!0,_=e}finally{try{v||null==m.return||m.return()}finally{if(p)throw _}}
//# sourceMappingURL=daux.min.js.map

2
docs/theme/php/php.css

File diff suppressed because one or more lines are too long

334
docs/theme/src/php.scss

@ -0,0 +1,334 @@
/* Daux imports; fonts are omitted */
@import "../../../vendor/daux/daux.io/src/css/theme_daux/vendor/normalize.scss";
@import "../../../vendor/daux/daux.io/src/css/theme_daux/_variables.scss";
@import "../../../vendor/daux/daux.io/src/css/theme_daux/_mixins.scss";
@import "../../../vendor/daux/daux.io/src/css/theme_daux/_structure.scss";
@import "../../../vendor/daux/daux.io/src/css/theme_daux/_typography.scss";
@import "../../../vendor/daux/daux.io/src/css/theme_daux/_components.scss";
@import "../../../vendor/daux/daux.io/src/css/theme_daux/_homepage.scss";
@import "../../../vendor/daux/daux.io/src/css/theme_daux/_print.scss" print;
/* Overrides */
:root {
--font-family-text: sans-serif;
--font-family-monospace: "Operator Mono SSm", "Operator Mono", monospace;
--font-family-heading: sans-serif;
--type-size-1: 1.75rem;
--type-size-2: 1.5rem;
--type-size-3: 1.25rem;
--type-size-4: 1.125rem;
--type-size-5: 1rem;
--type-size-6: 1rem;
--purple: #4f5b93;
--tyrian: #793862;
--light-purple: #8892bf;
--page: #f2f2f2;
--text: #333;
--red: #e63c2f;
--blue: #15284b;
--light-blue: #93b7bb;
--beige: #e8d5d3;
--green: #2c9a42;
--dark-gray: color(var(--beige) blend(var(--blue) 50%));
--gray: color(var(--beige) blend(var(--blue) 25%));
--light-gray: color(var(--beige) blend(var(--blue) 12.5%));
--lighter-gray: var(--beige);
--lightest-gray: color(var(--beige) blend(#fff 75%));
--dark: var(--text);
--light: var(--light-purple);
--sidebar-background: var(--text);
--sidebar-link-active-background: var(--tyrian);
--sidebar-link-color: var(--page);
--sidebar-link-secondary-color: var(--page);
--sidebar-collapsible--hamburger-color: var(--beige);
--link-color: #369;
--brand-color: #fff;
--brand-background: var(--purple);
--code-tag-background-color: transparent;
--code-tag-border-radius: 0;
--code-tag-box-shadow: none;
--homepage-navbar-background: var(--red);
--hero-button-block-background: var(--beige);
--homepage-hero-background: #fff;
--content-floating-blocks-background: var(--blue);
}
body {
line-height: 1.618;
font-size: 16px;
color: var(--text) !important;
}
body, .Columns__right__content {
background-color: var(--page);
}
a.Link--external::after {
content: '';
}
.Page__header h1 {
font-size: var(--type-size-6);
}
.s-content {
h1 {
font-size: var(--type-size-1);
}
h2 {
font-size: var(--type-size-2);
}
h3 {
font-size: var(--type-size-3);
}
h4 {
font-size: var(--type-size-4);
}
h5 {
font-size: var(--type-size-5);
}
h6 {
font-size: var(--type-size-6);
}
code {
padding-top: 0;
padding-bottom: 0;
padding: 0;
border: 0;
margin: 0;
&::before, &::after {
display: none;
}
pre & {
display: inline;
}
}
table {
border-collapse: separate;
border-spacing: 2px;
border: 2px solid var(--gray);
thead, tbody {
background-color: #fff;
}
tr {
border-top: 0;
&:nth-child(2n) {
background-color: transparent;
td {
background-color: var(--lightest-gray);
}
}
}
th, td {
border: 0;
}
}
}
.s-content table, .Nav__item .Nav__item {
font-size: 1rem;
}
.Brand, h1, h2, h3, h4, h5, h6 {
font-weight: 600;
font-stretch: condensed;
}
h1, h2, h3, h4, h5, h6 {
color: var(--tyrian);
}
.Button {
border-radius: 0;
}
.HomepageButtons .Button--hero {
font-weight: normal;
font-size: var(--type-size-6);
}
.Page__header {
border-bottom: 1px dotted var(--tyrian);
}
.Pager li > a {
border: 2px solid var(--lighter-gray);
border-radius: 0;
&:hover, &:focus {
background-color: var(--lighter-gray);
}
}
.Pager--prev a::before {
content: "\2190\00a0";
}
.Pager--next a::after {
content: "\00a0\2192";
}
.Navbar {
height: auto;
box-shadow: none;
.Brand {
float: none;
line-height: inherit;
height: auto;
}
}
.Homepage {
padding-top: 10px !important;
}
.Nav__item {
font-size: var(--type-size-6);
}
.Nav__arrow:before, .Nav .Nav .Nav__item a .Nav__arrow:before {
font-family: var(--font-family-heading);
width: 1ch;
height: 1ch;
}
.TableOfContentsContainer__title {
border-bottom: 4px solid var(--lighter-gray);
}
ul.TableOfContents {
border-left: 6px solid var(--lighter-gray);
}
.Columns__right--full .TableOfContentsContainer {
.TableOfContentsContainer__content > .TableOfContents {
border-right: 2px solid var(--lighter-gray);
}
a {
border-bottom: 1px solid var(--lighter-gray);
}
}
.clients {
thead tr:first-child th {
text-align: left;
&:first-child {
width: 15%;
}
&:nth-child(3) {
width: 50%;
text-align: center;
}
}
thead tr + tr th {
width: 12%;
text-align: center;
}
tbody td {
&:nth-child(3), &:nth-child(4), &:nth-child(5), &:nth-child(6) {
text-align: center;
}
&.Y {
color: var(--green);
}
&.N {
color: var(--red);
}
}
}
.hljs, .s-content pre {
background: var(--blue);
color: var(--beige);
}
.hljs {
display: block;
overflow-x: auto;
padding: 0.5em;
}
.hljs-emphasis {
font-style: italic;
}
.hljs-strong {
font-weight: bold;
}
.hljs-comment, .hljs-quote {
color: #978e9c;
}
/* Green */
.hljs-keyword, .hljs-selector-tag, .hljs-addition {
color: #acb39a;
}
/* Cyan */
.hljs-number, .hljs-string, .hljs-meta .hljs-meta-string, .hljs-literal, .hljs-doctag, .hljs-regexp {
color: var(--light-blue);
}
/* Blue */
.hljs-title, .hljs-section, .hljs-name, .hljs-selector-id, .hljs-selector-class {
color: #82b7e5;
}
/* Yellow */
.hljs-attribute, .hljs-attr, .hljs-variable, .hljs-template-variable, .hljs-class .hljs-title, .hljs-type {
color: #c5b031;
}
/* Orange */
.hljs-symbol, .hljs-bullet, .hljs-subst, .hljs-meta, .hljs-meta .hljs-keyword, .hljs-selector-attr, .hljs-selector-pseudo, .hljs-link {
color: #ea8031;
}
/* Red */
.hljs-built_in, .hljs-deletion {
color: var(--red);
}
.hljs-formula {
background: #686986;
}
@media (--viewport-large) {
.Columns__left {
border: 0;
}
}

17
package.json

@ -0,0 +1,17 @@
{
"devDependencies": {
"autoprefixer": "^9.6.1",
"postcss": "^7.0.0",
"postcss-cli": "^7.1.1",
"postcss-color-function": "^4.1.0",
"postcss-csso": "^4.0.0",
"postcss-custom-media": "^7.0.8",
"postcss-custom-properties": "^9.0.2",
"postcss-discard-comments": "^4.0.2",
"postcss-import": "^12.0.1",
"postcss-media-minmax": "^4.0.0",
"postcss-nested": "^4.1.2",
"postcss-sassy-mixins": "^2.1.0",
"postcss-scss": "^2.0.0"
}
}

17
postcss.config.js

@ -0,0 +1,17 @@
module.exports = ctx => ({
//map: ctx.options.map,
parser: 'postcss-scss',
//syntax: 'postcss-scss',
plugins: {
'postcss-import': { root: ctx.file.dirname },
'postcss-discard-comments': {},
'postcss-sassy-mixins': {},
'postcss-custom-media': {preserve: false},
'postcss-media-minmax': {},
'postcss-custom-properties': {preserve: false},
'postcss-color-function': {},
'postcss-nested': {},
'autoprefixer': {},
'postcss-csso': {},
}
})

1158
yarn.lock

File diff suppressed because it is too large
Loading…
Cancel
Save