Skip to content

Commit

Permalink
Merge pull request #1836 from hydephp/update-markdown-formatting
Browse files Browse the repository at this point in the history
Internal: Update documentation Markdown formatting
  • Loading branch information
caendesilva authored Jul 12, 2024
2 parents a12f18b + 1fff77f commit ab9c1c2
Show file tree
Hide file tree
Showing 31 changed files with 7 additions and 128 deletions.
2 changes: 0 additions & 2 deletions docs/advanced-features/advanced-features.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ HydePHP is a simple, yet powerful, static site generator. It is designed to be e

This section of the documentation will cover some of the more advanced (but optional) features of the framework.


## Prerequisites

To fully understand the features described in these chapters, it may be beneficial to first skim through the
Expand All @@ -22,7 +21,6 @@ You are also expected to have a basic understanding of PHP, and object-oriented

Having some familiarity with Laravel will also be beneficial, as HydePHP is built on top of the Laravel framework.


## Table of Contents

[Blade]: <ul>@foreach(glob(DocumentationPage::path('advanced-features/*.md')) as $file) <li> <a href="{{ basename($file, '.md') }}.html"> {{ Hyde::makeTitle(basename($file, '.md')) }} </a> </li> @endforeach</ul>
3 changes: 0 additions & 3 deletions docs/advanced-features/build-tasks.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ The built-in Hyde features like sitemap generation and RSS feeds are created usi
Maybe you want to create your own, to for example upload the site to FTP or copy the files to a public directory?
You can also overload the built-in tasks to customize them to your needs.


## Good to know before you start

### Types of tasks
Expand All @@ -31,7 +30,6 @@ In a way, build tasks are like micro-commands, as they can interact directly wit

In addition, there are some extra helpers available in the base BuildTask class that allow you to fluently format output to the console, which you will see in the examples below.


## Creating Build Tasks

### Minimal example
Expand Down Expand Up @@ -102,7 +100,6 @@ Running this task will produce the following output:

As you can see, there is no execution time tracking here, since we overrode the `printFinishMessage()` method that normally prints this. You can of course call the `withExecutionTime()` method to add this back in. See more in the API reference below.


## Registering the Tasks

There are a few ways to register these tasks so Hyde can find them.
Expand Down
9 changes: 0 additions & 9 deletions docs/advanced-features/hyde-pages.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ navigation:

>warning This article covers advanced information, and you are expected to already be familiar with [Page Models](page-models) and OOP

## Abstract

This page contains the full API references for the built-in HydePage classes. Most users will not need to know about
Expand Down Expand Up @@ -38,7 +37,6 @@ under the `HydePage` class documentation which is conveniently located just belo
| [DocumentationPage](#documentationpage) | Class for documentation pages. |
| [HtmlPage](#htmlpage) | Class for HTML pages. |


## HydePage

The base class for all Hyde pages. All other page classes extend this class.
Expand Down Expand Up @@ -120,7 +118,6 @@ abstract class HydePage

[Blade]: {{ Hyde\Markdown\Models\Markdown::fromFile(DocumentationPage::sourcePath('_data/partials/hyde-pages-api/interacts-with-front-matter-methods'))->toHtml($page::class) }}


## BaseMarkdownPage

The base class for all Markdown-based page models, with additional helpers tailored for Markdown pages.
Expand Down Expand Up @@ -149,7 +146,6 @@ abstract class BaseMarkdownPage extends HydePage

[Blade]: {{ Hyde\Markdown\Models\Markdown::fromFile(DocumentationPage::sourcePath('_data/partials/hyde-pages-api/base-markdown-page-methods'))->toHtml($page::class) }}


## InMemoryPage

Before we take a look at the common page classes, you'll usually use, let's first take a look at one that's quite interesting.
Expand Down Expand Up @@ -193,7 +189,6 @@ class InMemoryPage extends HydePage

[Blade]: {{ Hyde\Markdown\Models\Markdown::fromFile(DocumentationPage::sourcePath('_data/partials/hyde-pages-api/in-memory-page-methods'))->toHtml($page::class) }}


## BladePage

Page class for Blade pages.
Expand Down Expand Up @@ -222,7 +217,6 @@ class BladePage extends HydePage

[Blade]: {{ Hyde\Markdown\Models\Markdown::fromFile(DocumentationPage::sourcePath('_data/partials/hyde-pages-api/blade-page-methods'))->toHtml($page::class) }}


## MarkdownPage

Page class for Markdown pages.
Expand Down Expand Up @@ -251,7 +245,6 @@ class MarkdownPage extends BaseMarkdownPage

This class does not define any additional methods.


## MarkdownPost

Page class for Markdown blog posts.
Expand Down Expand Up @@ -286,7 +279,6 @@ class MarkdownPost extends BaseMarkdownPage

[Blade]: {{ Hyde\Markdown\Models\Markdown::fromFile(DocumentationPage::sourcePath('_data/partials/hyde-pages-api/markdown-post-methods'))->toHtml($page::class) }}


## DocumentationPage

Page class for documentation pages.
Expand Down Expand Up @@ -315,7 +307,6 @@ class DocumentationPage extends BaseMarkdownPage

[Blade]: {{ Hyde\Markdown\Models\Markdown::fromFile(DocumentationPage::sourcePath('_data/partials/hyde-pages-api/documentation-page-methods'))->toHtml($page::class) }}


## HtmlPage

Page class for HTML pages.
Expand Down
2 changes: 0 additions & 2 deletions docs/advanced-features/in-memory-pages.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ make sure you register it before the full application is booted so that routes c

_To see how to register the page, see the examples below. But first we must look at how to actually create the page._


## Creating the Page

To create an InMemoryPage, you need to instantiate it with the required parameters.
Expand All @@ -43,7 +42,6 @@ contents with the supplied front matter during the static site build process.
You can also register a macro with the name `compile` to overload the default compile method.


## API Reference

To see all the methods available, please see the [InMemoryPage API reference](hyde-pages#inmemorypage).
1 change: 0 additions & 1 deletion docs/architecture-concepts/architecture-concepts.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ then by all means, please read on! This is also a great place to start if you wa

>info For a high-level overview of these concepts, see the [Basic Architecture Concepts](core-concepts) page.

## Behind the Magic

Want to learn more about a particular feature? Click on the links below to visit the article.
Expand Down
2 changes: 0 additions & 2 deletions docs/architecture-concepts/autodiscovery.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ Before reading this article, you should be familiar with the following concepts:
- [Page Models](page-models)
- [The HydeKernel](the-hydekernel)


## Booting Pipeline

The autodiscovery is run when the HydeKernel boots. It does so in three distinct steps, which run in sequence as each
Expand All @@ -37,7 +36,6 @@ Usually, you will interact with the collection data through intermediaries.
* For example, if you call `MarkdownPost::get('my-post')`, Hyde will retrieve that page from the page collection.
* If you call `Routes::get('index')`, Hyde will retrieve that route from the route collection.


## The HydeKernel

If you have not yet read the [HydeKernel Documentation](the-hydekernel), here's a quick recap:
Expand Down
3 changes: 0 additions & 3 deletions docs/architecture-concepts/dynamic-data-discovery.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
[//]: # (Adds a pseudo-subtitle)
<h3 style="margin-top: 0px; margin-bottom: 20px;"><i>AKA: Front Matter & Filling in the Gaps</i></h3>


## Introduction

Hyde wants to allow developers to write less, and do more. This is also a major difference between HydePHP and JekyllRB.
Expand All @@ -18,7 +17,6 @@ your content, and not your markup, front matter is optional and Hyde will try to

If you're not happy with Hyde's generated data you can always override it by adding front matter to your files.


## How it Works

Now, to the fun part: getting into the nitty-gritty details of how Hyde does this!
Expand All @@ -37,7 +35,6 @@ There are a few factory classes. The one we will be looking at here is the `Hyde
responsible for data applicable to all page models. Complex structures and data only relevant to some page types
have their own factories, making the code more modular and maintainable.


## In-depth Overview of a Page Factory

Let's take a look at how Hyde will discover the title of a page as an example. Since this is something used by all pages,
Expand Down
2 changes: 0 additions & 2 deletions docs/architecture-concepts/extensions-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ Any other functionality you want to add to HydePHP, such as new commands or conf
can be added the same way as you would in Laravel, and are thus not part of our API.
See the [Laravel package development guide](https://laravel.com/docs/10.x/packages) for more.


## Creating Your Extension Class

The entry-point for your extension is your Extensions class. Within this, you can register the custom page classes.
Expand Down Expand Up @@ -113,7 +112,6 @@ class JsonPageExtension extends HydeExtension {
Since the discovery steps are handled sequentially, the added pages will automatically be discovered as routes without
us having to implement that handler method. As we inject the page objects directly, we bypass the need for the `FileCollection`.


## Registering Your Extension

Now that we have our extension class, we need to register it with HydePHP.
Expand Down
4 changes: 0 additions & 4 deletions docs/architecture-concepts/page-models.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ for your pages, also house instructions to Hyde on how to parse, process, and re

In this article, you'll get a high-level overview of the page models, and some code examples to give you a look inside.


## The Short Version

#### Page models are classes that have two primary concerns:
Expand All @@ -26,7 +25,6 @@ In this article, you'll get a high-level overview of the page models, and some c
- You don't construct page models yourself. HydePHP does it for you by the [autodiscovery process](autodiscovery).
- Page models are just PHP classes. You can extend them, and you can implement your own.


## The Page Model

To give you an idea of what a page model class looks like, here's a simplified version of the base `MarkdownPost` class,
Expand All @@ -52,7 +50,6 @@ class MarkdownPost extends BaseMarkdownPage
_Note that since Hyde pages are modular through class inheritance and traits, this example has been simplified and
edited to show all the relevant parts inlined into one class._


## Page Models as Blueprints

All page models have some static properties (that is, they belong to the class, not the instance) that are used as
Expand All @@ -78,7 +75,6 @@ and how the paths relate to each other. So for the class above, Hyde will thanks
* Compile the page using the `post` Blade template
* Output the compiled page to the `_site/posts` directory


## Page Models as Data Containers

As mentioned above, each page model instance also holds the page source contents, as well as the computed data.
Expand Down
3 changes: 0 additions & 3 deletions docs/architecture-concepts/the-hydekernel.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ Hyde::version(); // calls $HydeKernel->version()
The kernel is created very early on in the application lifecycle, in the `bootstrap.php` file, where it is also bound
as a singleton into the application service container.


## Accessing the Kernel

The HydeKernel is stored as a singleton in a static property in its own class and can be accessed in a few ways.
Expand All @@ -43,14 +42,12 @@ hyde()->version();

The Kernel instance is constructed and bound in the `app/bootstrap.php` file.


## The Kernel Lifecycle

Whenever we talk about the kernel being "booted" we are talking about the kernel's role in the autodiscovery process.

You can read all about it in the [Autodiscovery Documentation](autodiscovery).


## API Reference

Since the most common way to interact with the kernel is through the Hyde facade, we will use that for the examples.
Expand Down
4 changes: 0 additions & 4 deletions docs/creating-content/blog-posts.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,10 @@ php hyde make:post
```
Learn more about scaffolding posts, and other files, in the [console commands](console-commands) documentation.


## Short Video Tutorial

<iframe width="560" height="315" src="https://www.youtube-nocookie.com/embed/gjpE1U527h8" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>


## Best Practices and Hyde Expectations

Since Hyde does a lot of things automatically, there are some things you may need
Expand Down Expand Up @@ -73,7 +71,6 @@ Autem aliquid alias explicabo consequatur similique,
animi distinctio earum ducimus minus, magnam.
```


## Supported Front Matter Properties

### Post Front Matter Schema
Expand Down Expand Up @@ -201,7 +198,6 @@ image:
> for a detailed blog post with examples and schema information!
{ .info }


## Using Images in Posts

To use images stored in the `_media/` directory, you can use the following syntax:
Expand Down
1 change: 0 additions & 1 deletion docs/creating-content/compile-and-deploy.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ php hyde serve

---


## Deploying Your Site

One of the things that make static sites so enjoyable to work with is how easy it is to deploy them to the web.
Expand Down
7 changes: 1 addition & 6 deletions docs/creating-content/documentation-pages.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ to keep in mind when creating blog posts so that you don't get unexpected result
Like most of HydePHP, the Hyde Documentation module is highly customizable. Much of the frontend is composed using Blade templates and components, which you can customize to your heart's content.
Since there are so many components, it's hard to list them all here in the documentation, so I encourage you to check out the [source code](https://github.com/hydephp/framework/tree/master/resources/views/components/docs) to see how it's all put together and find the customizations you are looking for.


## Creating Documentation Pages

You can create a Documentation page by adding a file to the `_docs` directory where the filename ends in `.md`.
Expand All @@ -55,6 +54,7 @@ This will create the following file saved as `_docs/page-title.md`

```markdown
# Page Title

```

### Front Matter is optional
Expand All @@ -75,7 +75,6 @@ navigation:
---
```


## Dynamic Content Generation

Hyde makes documentation pages easy to create by automatically generating dynamic content such as the sidebar and page title.
Expand All @@ -94,7 +93,6 @@ and where the data is from as well as where it can be overridden.
| `navigation.hidden` (boolean) | Hides the page from the sidebar | _none_ | Front matter, config |
| `navigation.group` (string) | The group the page belongs to in the sidebar | Subdirectory, if nested | Front matter |


## Sidebar

The sidebar is automatically generated from the files in the `_docs` directory. You will probably want to change the order
Expand Down Expand Up @@ -182,7 +180,6 @@ This can be useful to create redirects or other items that should not be shown i

>info The index page is by default not shown as a sidebar item, but instead is linked in the sidebar header. <br>


## Customization

Please see the [customization page](customization) for in-depth information on how to customize Hyde,
Expand Down Expand Up @@ -276,7 +273,6 @@ If you set this to false, Hyde will match the directory structure of the source
'flattened_output_paths' => true,
```


## Search Feature

### Introduction
Expand Down Expand Up @@ -323,7 +319,6 @@ navigation menu items are hidden. The page will still be accessible as normal bu

The Realtime Compiler that powers the `php hyde serve` command will automatically generate a fresh search index each time the browser requests it.


## Automatic "Edit Page" Button

### Introduction
Expand Down
5 changes: 0 additions & 5 deletions docs/creating-content/managing-assets.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ Some extra custom styles are made in the HydeFront package, which is pre-install
To get you started quickly, all the styles are already compiled and minified into `_media/app.css`,
which will be copied to the `_site/media/app.css` directory when you run `php hyde build`.


## Additional Information and Answers to Common Questions

### Is NodeJS/NPM Required for Using Hyde?
Expand All @@ -33,7 +32,6 @@ If you want to customize the Tailwind settings or add custom styles, you will ne
For example, if you customize the Blade views and add new classes or add new classes in Blade-based pages, you may need to compile the assets yourself to get the new styles.
If you use Markdown-based pages, you do not need to compile anything as those styles are already included in the compiled CSS file.


## How are assets stored and managed?

The frontend assets are separated into three places.
Expand All @@ -55,7 +53,6 @@ It may seem weird to have two folders for storing the compiled assets, but it is
The `_site` directory is intended to be excluded from version control, while the `_media` folder is included in the
version control. You are of course free to modify this behaviour by editing the `webpack.mix.js` file to change the output directory.


## How Do I Compile assets?

First, make sure that you have installed all the NodeJS dependencies using `npm install`.
Expand All @@ -71,7 +68,6 @@ When running the `npm run dev/prod` command, the following happens:
1. Laravel Mix will compile the `resources/assets/app.css` file into `_media/app.css` using PostCSS with TailwindCSS and AutoPrefixer.
2. Mix then copies the `_media` folder into `_site/media`, this is so that they are automatically accessible to your site without having to rerun `php hyde build`.


## Telling Hyde where to find assets

### Customizing the Blade templates
Expand Down Expand Up @@ -110,7 +106,6 @@ so the Play CDN styles match the ones created by Laravel Mix.

All in all, this allows you to tinker around with Tailwind without having to compile anything.


## Managing Images

As mentioned above, assets stored in the _media folder are automatically copied to the _site/media folder,
Expand Down
Loading

0 comments on commit ab9c1c2

Please sign in to comment.