vuejs/vuepress

Migrating from Gitbook

Open

#951 aperta il 22 ott 2018

Vedi su GitHub
 (5 commenti) (0 reazioni) (0 assegnatari)JavaScript (4782 fork)batch import
help wanted

Metriche repository

Star
 (22.300 star)
Metriche merge PR
 (Nessuna PR mergiata in 30 g)

Descrizione

I am trying to migrate some docs from Gitbook and being brand new to VuePres I am unsure of how to do something. We have these conditionals in our docs that are used for 2 purposes. When we are running the documentation in dev mode (gitbook serve) they only show 1 language. The more important piece is that when we build it we build documentation for a specific language. That means where ever we see these conditionals they need to be evaluated, only show one language and build it into that languages folder (java/.net/etc)

{% if book.language === "Java" %}
    int numOfBananas = ...;
    String message = 
        "We have " + numOfBananas + " banana" + (numOfBananas != 1 ? "s" : "");
{% elif book.language === 'C#' %}
    int numOfBananas = ...;
    string message = 
        "We have " + numOfBananas + " banana" + (numOfBananas != 1 ? "s" : "");
{% endif %}

I know I can use vue directives and logic in my markdown files but what I am unsure how to do is pass additional options to vuepress dev and vuepress build and where to store those options. Any help here would be greatly appreciated.

Guida contributor