Skip to content

Commit

Permalink
docs & mkdocs material
Browse files Browse the repository at this point in the history
  • Loading branch information
jakubmisek committed Aug 25, 2024
1 parent 3a169b0 commit 8c23def
Show file tree
Hide file tree
Showing 22 changed files with 203 additions and 15 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -256,4 +256,5 @@ paket-files/
wordpress/wp-content/plugins/akismet
wordpress/wp-content/plugins/hello.php
wordpress/wp-content/themes/twentysixteen
wordpress/wp-content/uploads/
wordpress/wp-content/uploads/
docs/site
4 changes: 0 additions & 4 deletions docs/.pages

This file was deleted.

14 changes: 14 additions & 0 deletions docs/.vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "serve",
"request": "launch",
"type": "node-terminal",
"command": "mkdocs serve"
}
]
}
4 changes: 2 additions & 2 deletions docs/add-plugin-theme.md → docs/content/add-plugin-theme.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,5 @@ Using **Visual Studio**, right click on your project and click command `Manage N

Package is created from regular PHP WordPress plugin or theme. Refer to following instructions on how to create a .NET project and eventually a NuGet package from sources:

- [Build a plugin](../build-php-plugin/)
- [Build a theme](../build-php-theme/)
- [Build a plugin](build-php-plugin.md)
- [Build a theme](build-php-theme.md)
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ The following tutorial is shown in Visual Studio 2019.

```

The optional `services.AddWordPress( ... )` can be used to alter the WordPress configuration, such as the Site URL, database connection credentials and others, as described in [configuration](../configuration/).
The optional `services.AddWordPress( ... )` can be used to alter the WordPress configuration, such as the Site URL, database connection credentials and others, as described in [configuration](configuration.md).

5. Prepare the MySQL server. Make sure you have MySQL server running:

Expand Down
4 changes: 2 additions & 2 deletions docs/build-php-plugin.md → docs/content/build-php-plugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ By default, plugins are compiled automatically just by copying them into the Wor
- you need to have source code of the plugin on the server (security).
- eventual code errors are revealed upon starting the application (reliability).

In order to avoid those issues, plugins can be pre-compiled during the deployment process. A single WordPress plugin or the `plugins` directory is then defined as a PHP class library project (below) which is then referenced by the application (see [overview](overview)). Application can have references to one or more plugin projects.
In order to avoid those issues, plugins can be pre-compiled during the deployment process. A single WordPress plugin or the `plugins` directory is then defined as a PHP class library project (below) which is then referenced by the application (see [overview](index.md)). Application can have references to one or more plugin projects.

**Sample project**: https://github.com/iolevel/peachpie-wordpress/tree/master/MyContent

Expand Down Expand Up @@ -76,7 +76,7 @@ The process will build the plugin project. Eventual warnings will be outputed. A
### Add plugin to the application

Assuming you have ASP.NET Core Application (called *app*) with WordPress (see [quick start](../overview/#quick-start)). Adding plugins to the application is equivalent to adding project references or package references.
Assuming you have ASP.NET Core Application (called *app*) with WordPress (see [quick start](index.md#quick-start)). Adding plugins to the application is equivalent to adding project references or package references.

Either add project reference to the plugin in Visual Studio IDE, or on command line, or edit the application's project file:

Expand Down
4 changes: 2 additions & 2 deletions docs/build-php-theme.md → docs/content/build-php-theme.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Build a PHP theme

Please see [Build a Plugin](build-php-plugin) for more details.
Please see [Build a Plugin](build-php-plugin.md) for more details.

Single theme for WordPress or the whole `themes` directory is defined as a PHP class library project (below) which is then referenced by the application. Application can have references to one or more themes.

Expand Down Expand Up @@ -52,7 +52,7 @@ The process will build the theme project. Eventual warnings will be outputed. An
### Add theme to the application

Assuming you have ASP.NET Core Application (called *app*) with WordPress (see [quick start](../overview/#quick-start)). Adding themes to the application is equivalent to adding project references or package references.
Assuming you have ASP.NET Core Application (called *app*) with WordPress (see [quick start](index.md#quick-start)). Adding themes to the application is equivalent to adding project references or package references.

Either add project reference to the theme in Visual Studio IDE, or on command line, or edit the application's project file:

Expand Down
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
13 changes: 10 additions & 3 deletions docs/overview.md → docs/content/index.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
---
title: Overview
social:
cards_layout_options:
title: Documentation that simply works
---

# Overview

[WpDotNet](https://wpdotnet.peachpie.io/) is the unmodified WordPress, running compiled purely on .NET, provided as a NuGet package & ready to be used as a part of an ASP NET Core application. WpDotNet comes with additional components and features, making it easy to be used from C# and a .NET development environment in general.
Expand All @@ -6,7 +13,7 @@ The project does not require PHP to be installed, and is purely built on top of

## Requirements

- .NET CoreSDK 3.0, .NET SDK 5.0, or newer. ([dotnet.microsoft.com](https://dotnet.microsoft.com/download) or [visualstudio.microsoft.com](https://visualstudio.microsoft.com/vs/))
- .NET SDK 6.0, or newer. ([dotnet.microsoft.com](https://dotnet.microsoft.com/download) or [visualstudio.microsoft.com](https://visualstudio.microsoft.com/vs/))
- MySQL Server ([dev.mysql.com](https://dev.mysql.com/downloads/mysql/) or [docker](https://hub.docker.com/_/mysql))

Make sure you have valid credentials to your MySQL server and you have created a database in it. The following quick start expects a database named `"wordpress"`. Database charset `"UTF-8"` is recommended.
Expand All @@ -20,7 +27,7 @@ Open or create an ASP NET Core application, version 3.0 or newer.
Add a package reference to [`"Peachpied.WordPress.AspNetCore"`](https://www.nuget.org/packages/PeachPied.WordPress.AspNetCore/) (note it is a **pre-release** package):

```shell
dotnet add package PeachPied.WordPress.AspNetCore --version 6.3.1-rc-016
dotnet add package PeachPied.WordPress.AspNetCore --version 6.5.4-rc-020
```

Add the WordPress middleware within your request pipeline, in the `Configure` startup method:
Expand Down Expand Up @@ -54,7 +61,7 @@ public partial class Startup
}
```

> Note: the recommended approach is to place the configuration within the `appsettings.json` configuration file. See [configuration](../configuration) for more details.
> Note: the recommended approach is to place the configuration within the `appsettings.json` configuration file. See [configuration](configuration.md) for more details.
## Dashboard

Expand Down
4 changes: 4 additions & 0 deletions docs/content/patreon.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
title: Patreon
---

164 changes: 164 additions & 0 deletions docs/mkdocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,164 @@
# Project information
site_name: WpDotNet - WordPress on .NET
site_url: https://www.wpdotnet.com/
site_author: PeachPie Team
site_description: >-
This site provides WpDotNet project documentation and useful tips.
# Repository
repo_name: iolevel/wpdotnet
repo_url: https://github.com/iolevel/wpdotnet

# Copyright
copyright: Copyright &copy iolevel s.r.o. All rights reserved.

# Configuration
theme:
name: material
features:
- announce.dismiss
#- content.action.edit
#- content.action.view
- content.code.annotate
- content.code.copy
- content.code.select
# - content.footnote.tooltips
# - content.tabs.link
- content.tooltips
# - header.autohide
# - navigation.expand
- navigation.footer
- navigation.indexes
# - navigation.instant
# - navigation.instant.prefetch
# - navigation.instant.progress
# - navigation.prune
- navigation.sections
- navigation.tabs
- navigation.tabs.sticky
- navigation.top
- navigation.tracking
- search.highlight
- search.share
- search.suggest
- toc.follow
# - toc.integrate
palette:
- media: "(prefers-color-scheme)"
toggle:
icon: material/link
name: Switch to light mode
- media: "(prefers-color-scheme: light)"
scheme: default
primary: indigo
accent: indigo
toggle:
icon: material/toggle-switch
name: Switch to dark mode
- media: "(prefers-color-scheme: dark)"
scheme: slate
primary: black
accent: indigo
toggle:
icon: material/toggle-switch-off
name: Switch to system preference
font:
text: Roboto
code: Roboto Mono
favicon: assets/favicon.png
icon:
logo: logo

# Plugins
plugins:
# - blog
# - search:
# separator: '[\s\u200b\-_,:!=\[\]()"`/]+|\.(?!\d)|&[lg]t;|(?!\b)(?=[A-Z][a-z])'
- minify:
minify_html: true

# Hooks
# hooks:
# - material/overrides/hooks/shortcodes.py
# - material/overrides/hooks/translations.py

# Additional configuration
extra:
status:
new: Recently added
deprecated: Deprecated
analytics:
provider: google
property: !ENV GOOGLE_ANALYTICS_KEY
generator: false
social:
- icon: fontawesome/brands/github
link: https://github.com/peachpiecompiler
- icon: fontawesome/brands/x-twitter
link: https://x.com/pchpcompiler
- icon: fontawesome/brands/facebook
link: https://facebook.com/pchpcompiler
- icon: fontawesome/brands/youtube
link: https://youtube.com/@PEACHPIE
- icon: fontawesome/brands/discord
link: https://discord.com/channels/1198334116182102177/1198334116182102180



# Extensions
markdown_extensions:
- abbr
- admonition
- attr_list
- def_list
- footnotes
- md_in_html
- toc:
permalink: true
- pymdownx.arithmatex:
generic: true
- pymdownx.betterem:
smart_enable: all
- pymdownx.caret
- pymdownx.details
- pymdownx.emoji:
emoji_generator: !!python/name:material.extensions.emoji.to_svg
emoji_index: !!python/name:material.extensions.emoji.twemoji
- pymdownx.highlight:
anchor_linenums: true
line_spans: __span
pygments_lang_class: true
- pymdownx.inlinehilite
- pymdownx.keys
- pymdownx.magiclink:
normalize_issue_symbols: true
repo_url_shorthand: true
user: squidfunk
repo: mkdocs-material
- pymdownx.mark
- pymdownx.smartsymbols
- pymdownx.snippets:
auto_append:
- includes/mkdocs.md
- pymdownx.superfences:
custom_fences:
- name: mermaid
class: mermaid
format: !!python/name:pymdownx.superfences.fence_code_format
- pymdownx.tabbed:
alternate_style: true
combine_header_slug: true
slugify: !!python/object/apply:pymdownx.slugs.slugify
kwds:
case: lower
- pymdownx.tasklist:
custom_checkbox: true
- pymdownx.tilde

# Page tree

docs_dir: content

# nav:
# - Home: 'index.md'
# - Patreon: 'patreon.md'
2 changes: 2 additions & 0 deletions docs/setup.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
pip install mkdocs mkdocs-material mkdocs-minify-plugin
mkdocs build

0 comments on commit 8c23def

Please sign in to comment.