vuejs/vuepress

Migrating from Gitbook

Open

#951 opened on Oct 22, 2018

View on GitHub
 (5 comments) (0 reactions) (0 assignees)JavaScript (4,782 forks)batch import
help wanted

Repository metrics

Stars
 (22,300 stars)
PR merge metrics
 (No merged PRs in 30d)

Description

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.

Contributor guide