USER MANUAL =========== Welcome to W's manual ! To understand the key concepts of W, you should check the introduction on [W's website](https://w.club1.fr/usage.html). Management ---------- W let you manage a database of pages. All those pages have an [unique ID](#page-id) and have an address corresponding to `/PAGE_ID`. You can create, edit and delete pages using [URL commands](#url-based-command-interface): - To __create a page__, you can use the [/add](#add) command. Type in your address bar `PAGE_NAME/add`. - To __edit a page__, you can use the [/edit](#edit) command. Type `/edit` after a page ID. To create a page, users need to be [editors](#editor) or above. ### Home The Home interface is the main view of your project. You can access it only when you're connected. All the pages of your database are listed here. The [readers](#reader) and [invite editors](#invite-editor) can't access this interface. ### Filters Filter system is at the heart of W. It's the only way to organize your pages as there is no other form of hierarchy. You can use them to filter your page database and later to insert [list of pages](#page-list) in your pages. ### Bookmarks Bookmarks are there to store a preset of [filters](#filters). To create a bookmark, after ajusting [filters and sorting options](#options), select the bookmark menu in the [home menu](#home-menu), add a name and a symbol. This will add a new bookmark on the left side of the home view ! You can ajust bookmarks infos more precisely later: select a bookmark in the [bookmark panel](#bookmark-panel), then click on the bookmark tab in the [home menu](#home-menu). **Title** and **description** can be edited. There are two kinds of bookmarks: - **public bookmark** Can only be created and edited by [super editor](#super-editor) and above. Every users that can access home view will be able to see and use them. - **private bookmark** Can be created by [editor](#editor) and above. They are user specific. Personnal bookmarks can only be accessed by their owners. #### Publish a RSS feed __Public__ bookmarks can be used to publish a RSS feed. After selecting a bookmark in the panel, open the bookmark menu and select "publish". This will generate an XML Atom file in the `assets` folder. You can see this file by clicking on the RSS symbol , next to a published bookmark. To help visitor access this RSS feed, you can copy and paste a piece of [code to include in pages](#rss-link). When you update or add pages in the bookmark's scope, you need to manually refresh the RSS feed by clicking the refresh button. ### confidentiality To manage which page are accessible to who, editors can set the [privacy level of their pages](#privacy). #### search engine indexing When something is public on the Web, and at least one hyperlink point to it, it will sooner or later became indexed by some robots. The most traditionnal ones are the **search engines Web crawlers** (sometimes even called spiders). When a page or a media is indexed by one of those robots, the associated search engine may display the ressource on their results lists. Hopefully, we can tell those robot not to index our content by using a tag called `noindex`. Inside W, this can be set per page under "advanced setting" in edit interface, or using multi-edit feature in home view. In home view, page that are set as `noindex` are signified with a search symbol in the **privacy** column. > Note that this is only usefull for `public` pages as the others are not published on the Web. But it won't cause any harm either. Page Editing ------------ Editing pages is the core feature of W. The edition interface is accessible when [typing `/edit`](#edit) after an existing [page ID](#page-id) in the address bar. Or from the [home](#home), by clicking on the pencil button. The pages are rendered and then cached until some new edit is performed on them or their [templates](#templating). If you want to manually render a page, use the [render](#render) URL command by typing `/render` after the page ID. Render should be quick (unless the [URL checker](#url-checker) is enabled), but it's not instantaneous. To have a idea of the last render duration of a page, one can check the end of the HTML of any rendered page (CTRL + U in most browsers). It should look like this: ``` ``` To have a more precise idea of how the render process work, you can check [RENDER.md](https://github.com/vincent-peugnet/wcms/blob/master/RENDER.md) file. ### Edition interface [Invite editors](#invite-editor) and [editors](#editor) users can only access edition of pages where they are listed as [author](#authors). The Edition view is composed of a main content edition area, surounded by two lateral panels that you can deploy or hide. This is where you can edit page [metadatas](#metadatas). **shortcuts** - Press CTRL + S or "update" button to save your edits. - Press CTRL + D or "display" button to view your page. This will open a new tab. ### Rendering cache To avoid re-rendering a page each time somebody want to read the page, W store the last rendered version of a page *in cache*. This cache is invalidated each time some edit is done to the page. And also, if a page use a [BODY template](#body-template) that have been edited meanwhile. To by-pass the rendering cache anytime, connected users can use the [`/render` command](#render). #### cache expiration But cache is not forced to live forever ! It's maximum life time can be globally defined in [admin panel](#administration). It have to be set in seconds. To disable cache expiration, this value can be set to `-1`. If cache life time is set to 0 seconds, W will never use caching. This is not recommanded in production as this will most of the time waste ressources. > 💡 [counters inclusions](#counters-inclusion) are not affected by the render cache as they are included at reading time, after the rest of the page has beed rendered. Caching is very efficient for simple pages, as they mainly depend on their own content update. On the over hand, it can be quite problematic for pages that use more dynamic content. For example: a page that use a [generated list](#page-list) of "the last 5 edited pages", will have its cache outdated way more often ! That's why if you want some pages to have a specific cache expiration duration, this can be set under the advanced section in the left panel of the page edition inferface. This setting use the same logic as the global one described above. #### edit propagation Another option is to activate a strange option called "invalidate rendering of linked pages when updating" in the [admin panel](#administration). This option assumes that related pages have more change to be affected by each others edit. So when a page is edited, all the page that are related have their render cache unvalidated. This technique is quite hazardous and won't do magic, but it may help to reduce inconsistency. ### Syntax W take advantage of the *Markdown* syntax, flavored with a few specific syntax. #### Markdown Markdown can be used by default in [content elements](#content-elements) but never in the [BODY](#body). Markdown language is a common markup language. It's meant to be more human readable than HTML, but at the same time more limited. It's important to notice that you can mix Markdown and HTML. But beware, as HTML can be used inside markdown, the opposite is not possible. - [Markdown Guide](https://www.markdownguide.org/) Markdown Syntax guide - [Michel Fortin's Markdown extra](https://michelf.ca/projects/php-markdown/extra/) The library used in W. #### Internal links Internal links are links that point to the pages that are managed by this instance of W. As those pages are all under the same domain and path, you don't need to use the full `https://...` adress to create internal links. You just need to use the [page identifier](#page-id). Here are some examples Using __Markdown__: [a link to my nice page](PAGE_ID) With __HTML__: link to my page As you can see, you always need to setup the text of the link. But what if we could just have [page's title](#page-title) instead ? [Wiki links are here for that purpose](#wiki-links). ##### Combine with commands Internal links can be combined with the [URL commands](#url-based-command-interface) to achieve diabolic means. For example, you can create a link to directly edit a page using like this: [edit the page](PAGE_ID/edit) #### Wiki links Wiki links can be used in the [content](#content-elements) only (not in the [body](#body)). Wiki style links are __only for internal links__. Their main interest compared to markdon links is that the clickable part of the link will be replaced by [page's title](#page-title) if it exist. [[PAGE_ID]] Will generate : TITLE Where `DESCRIPTION`, `TITLE` and `ID` are the [description](#description) and [title](#page-title) of the page related to the [id](#page-id). Note that the `.internal` class have been added to the `a` html link, allowing you to differenciate internal link styling from `.external`. To achieve the same behaviour in the BODY, one can use the [title inclusion](#title-inclusion) with the ID parameter. For example, with a link to a page with ID `my_page`: ```html %TITLE?id=my_page% ``` ### Styling links During the render process, some semantic datas are added to the __HTML classes of links__. It's intended to help editor style their Webpages. - `page` link to a page of your W - `internal`, `external` differenciate internal and external links - `existnot`, `exist` in case of internal link, indicate if page exist or not - `public`, `private`, `not_published` if page exist, indicate it's [privacy](#privacy) level - `current_page` the link point to the current page #### URL checker If this option is activated in admin panel, W can verify if external links are still working. If a link have been checked, a class is added to the link: - `ok` if the url is considered as working - `dead` if the url seems to be dead URLs __response codes that are considered alives__ are: - `2**` valid range - `401` *Unauthorized* - `403` *Forbidden* - `405` *Method Not Allowed* URL checking is done every time a page is displayed by a logged in editor, if rendering needs to be done (because of edits or new comments) and that some URLs has'nt been checked yet or that their cache is expired. This may cause page loading longer if there's a lot URL to check. The __checking duration is limited to 3 seconds__ (it often allow to check between 10 - 20 URLs). The rest will stay as "un-checked" and will wait for next check. Depending on the result, URL status is stored in cache for a certain amount of time. Each alive URL cache expire in ~100 days. The errored URL cache expire way sooner (a few minutes). Each times it's checked, the cache duration of errored URLs will increase if the status continue to be the same. This is done in order to reduce the check frenquency of the most "stables" broken URLs. > 💡 URLs from the __same domain__ are never checked in the same batch to avoid rate limiting. URL cache can be managed by [super editors](#super-editor) or above. The management interface can be reached from the main menu. #### CSS examples To color in red internal links to page that does not exist: ```css a.page.existnot { color: red; } ``` Add a symbol after external links: ```css a.external::after { content: "➚"; } ``` ```css a.dead::after { content: " ☠️"; } ``` > 💡 If you want to go further, you can also use [CSS attribute selector](https://developer.mozilla.org/en-US/docs/Web/CSS/Attribute_selectors) to achieve more complex rules. ### Inclusions Inclusion is an advanced feature of W that allow editors to insert metadatas, generate content using codes. Those codes are always inside percent signs `%`. Inclusions can be called in [content elements](#content-elements) and in [body](#body). #### Basic inclusions Those codes are mainly used to print page's [metadatas](#metadatas). They are very usefull combined with [BODY templating](#body-template) ##### Title inclusion %TITLE% This will include the current page [title](#page-title). It can take an `id` parameter to get the title of another page. For example, to include the title of the page `homard`: %TITLE?id=homard% ##### Description inclusion %DESCRIPTION% This will include the page [description](#description). ##### Date and time inclusion Will print date metadata of the page into an HTML `