GithubHelp home page GithubHelp logo

skoch98 / pimcore-pimcore-docs Goto Github PK

View Code? Open in Web Editor NEW

This project forked from pimcore/pimcore-docs

0.0 0.0 0.0 1.55 MB

Pimcore documentation generator built on daux.io.

License: Other

Shell 23.31% JavaScript 19.57% PHP 38.74% Less 18.38%

pimcore-pimcore-docs's Introduction

Pimcore Docs Generator used for Version 4 to 10

The current documentation is generated by Docusaurus in a different repository

Pimcore documentation generator built on daux.io. It uses daux as composer dependency instead of forking and altering the daux repo itself.

Usage

After running a composer install you can build the documentation with the following steps:

  1. Prepare rendering with the prepare command. This will copy the documentation files from the Pimcore repository, rename README.md files to _index.md (and fix internal links) and create config file for the selected Pimcore version. The path is the path to the doc directory in the Pimcore repository.

    Required options are:

    • config-file: The config file to use.
    • repository-version: The version of the documentation.
    • repository-version-label: The name of version of the documentation, e.g. current (6.8).
    • repository-version-maintained: If version is maintained, 'true' or 'false')
    • version-map-file: Path to version map file for building version switch.
    • version-switch-path-prefix: Url prefix that is added to version switch urls, following schema '//_index.html'.
    $ bin/console prepare \ 
       --config-file=./config/pimcore6.json \
       --repository-version=master \
       --repository-version-label=master \
       --repository-version-maintained=true \
       --version-map-file=./versionmaps/pimcore.json \
       --version-switch-path-prefix=<build_path> \
       <path to pimcore checkout>/doc <build_path>/master
    
  2. View in live mode (optional). You can use live mode to quickly test changes. If you change a documentation file in the Pimcore repository make sure you run prepare again.

    $ bin/console serve
    
  3. Generate static files

    $ bin/console generate --source <build_path>/master --configuration-file <build_path>/master/config.json  
    

Generated files will be written to build/static.

Version Switch

Version switch information is generated into a version map file and based on file names. If in different versions the same documentation (same name) file exists, then a version switch is possible for that documentation page. The version switch is visible when there are other versions to switch to of the current file.

Since prepare command populates the version map file, it might be necessary to run the prepare command for all versions twice, so that version map file can be fully populated. Only then the version switch is visible on all possible pages.

Lightbox Images

For converting images to small thumbnails with simple lightbox functionality, use following syntax:

<div class="image-as-lightbox"></div>

![Profile Menu](../../img/user_docs/profile-menu.png)

The image that comes directly after .image-as-lightbox element is converted.

Using pimcore-docs for other package's documentations

This tool can be used for generating docs of any package (e.g. for a Pimcore Bundle). To do so, follow these steps:

  • Add a config.json in your documentation directory e.g. doc/config.json. Take a look at the config/ directory and at the Daux docs to get started.
  • Use the pimcore-generic template variant by setting "theme": "pimcore-generic" in the config.json. You can also specify a custom theme dir to the serve and generate commands and use a completely custom theme and theme dir (see Daux docs for details on themes).

You can now use your custom config file by just passing the config file to the prepare command:

$ bin/console prepare ../my-bundle/doc -c ../my-bundle/doc/config.json

If you want to use a completely custom theme directory make sure to pass it to the serve and generate commands:

$ bin/console serve -t ../my-bundle/themes
$ bin/console generate -t ../my-bundle/themes

Highlighting Special Docs

It is possible to add a ribbon and a subtitle to the documentation header. The ribbon is shown on right side of the logo in the navigation header, the subtext blow the logo.

Subtitle and ribbon text are defined in the config-file as follows:

{
    "title": "some special enterprise bundle for Pimcore",
    "sub_title": "Special bundle",
    "html": {
        "ribbon_text": "Enterprise"
    }
}

Theme development

Install prerequisites:

  • NodeJS
  • Yarn
  • Install dependencies: yarn

Alter files in themes/pimcore, run gulp to build CSS and JS files and commit generated files back to the repository. You can use gulp watch to watch styles and scripts and automatically rebuild assets.

Generating Pimcore Docs

In this bundle there are a couple of bash scripts to generate docs of Pimcore and its highlight extensions for multiple versions based on the configuration files shipped with the repository. They are all located under /bin and executed as follows:

./do-generate.sh settings-pimcore.sh

In settings files there are all necessary settings for versions, repositories, etc.

#!/bin/bash

# all paths relative to pimcore-docs/bin

tags=(       "master"  "v6.7.2"        "v6.6.11" "v6.5.3" "v6.4.2" "v6.3.6" "v6.2.2" "v6.1.2" "v6.0.5" "v5.8.9" "4.6.5" )
versions=(   "master"  "current"       "6.6"     "6.5"    "6.4"    "6.3"    "6.2"    "6.1"    "6.0"    "5.8"    "4.6"   )
labels=(     "master"  "6.7 (current)" "6.6"     "6.5"    "6.4"    "6.3"    "6.2"    "6.1"    "6.0"    "5.8"    "4.6"   )
maintained=( "true"    "true"          "false"   "false"  "false"  "false"  "false"  "false"  "false"  "false"  "false" )

repository="pimcore"
outputPath="/docs/pimcore"

configFilePath="../config"
versionSwitchPathPrefix="/docs"
configFileBaseName="pimcore"
configFileDefault="pimcore-6.json"

additionalPrepareConfigs=""

To add a new bundle for generation, just have a look at existing configuration files and create a new one and pass it as parameter to the do-generate.sh script.

pimcore-pimcore-docs's People

Contributors

maff avatar brusch avatar fashxp avatar mcop1 avatar dvesh3 avatar robertst7 avatar aryaantony92 avatar jdreesen avatar bitfactory-jurgen-jansma avatar niklasbr avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.