DOC: Move all docs into en/ subdirectory (#1505)

* DOC: Move all docs into en/ subdirectory

PR #1502 is working on adding a Chinese translation to the docs. In
general, I encouraged this (in #1452) as a path towards getting useful
translated content in the game without requiring a massive
refactor/rearchitecting of everything.

To support this, this takes the first step of moving our docs into an
en/ subdirectory, so that other languages can live alongside. No effort
is made at this time to support or select between alternate languages;
this is a pure-rename refactor.
This commit is contained in:
David Walker
2025-07-19 19:15:56 -07:00
committed by GitHub
parent a2a4a2a0b4
commit 4059be3d8c
74 changed files with 150 additions and 139 deletions

View File

@@ -224,7 +224,7 @@ the following rules:
## As a Documenter
To contribute to and view your changes to the BitBurner documentation in-game, you will
need to edit the files in [this folder](https://github.com/bitburner-official/bitburner-src/tree/dev/src/Documentation/doc)
need to edit the files in [this folder](https://github.com/bitburner-official/bitburner-src/tree/dev/src/Documentation/doc/en)
To make change to the [in-game documentation](./markdown/bitburner.md), you will need to modify the [TypeScript definitions](./src/ScriptEditor/NetscriptDefinitions.d.ts), not the Markdown files.

View File

@@ -19,7 +19,7 @@ There are 2 types of documentation:
- NS API documentation: It's generated from the [TypeScript definitions](./src/ScriptEditor/NetscriptDefinitions.d.ts). You can read it at https://github.com/bitburner-official/bitburner-src/blob/stable/markdown/bitburner.md.
Anyone is welcome to contribute to the documentation by editing the [source
files](/src/Documentation/doc) and then making a pull request with your contributions.
files](/src/Documentation/doc/en) and then making a pull request with your contributions.
For further guidance, please refer to the "As A Documenter" section of
[CONTRIBUTING](./CONTRIBUTING.md#as-a-documenter).

View File

@@ -1,5 +1,5 @@
.. meta::
:http-equiv=Refresh: 0; url='https://github.com/bitburner-official/bitburner-src/blob/stable/src/Documentation/doc/index.md'
:http-equiv=Refresh: 0; url='https://github.com/bitburner-official/bitburner-src/blob/stable/src/Documentation/doc/en/index.md'
This link is outdated as documentation for Bitburner has been migrated to an in-game menu, this page should have redirected you to the new location.
You can also click `here to go to the game's documentation <https://github.com/bitburner-official/bitburner-src/blob/stable/src/Documentation/doc/index.md/>`_.
You can also click `here to go to the game's documentation <https://github.com/bitburner-official/bitburner-src/blob/stable/src/Documentation/doc/en/index.md/>`_.

View File

@@ -107,7 +107,7 @@ export const CONSTANTS = {
// Only use this if a backdoor is installed in the company's server
CompanyRequiredReputationMultiplier: 0.75,
// Also update Documentation/doc/changelog.md when appropriate (when doing a release)
// Also update Documentation/doc/en/changelog.md when appropriate (when doing a release)
LatestUpdate: `
## v3.0.0 developement version: last updated 4 April 2025

View File

@@ -1,68 +1,68 @@
// THIS FILE IS AUTOGENERATED. DO NOT EDIT IT MANUALLY.
import file0 from "./doc/advanced/bitnode_recommendation_comprehensive_guide.md?raw";
import file1 from "./doc/advanced/bitnode_recommendation_short_guide.md?raw";
import file2 from "./doc/advanced/bitnodes.md?raw";
import file3 from "./doc/advanced/bladeburners.md?raw";
import file4 from "./doc/advanced/corporation/basic-gameplay-and-term.md?raw";
import file5 from "./doc/advanced/corporation/boost-material.md?raw";
import file6 from "./doc/advanced/corporation/demand-competition.md?raw";
import file7 from "./doc/advanced/corporation/division-raw-production.md?raw";
import file8 from "./doc/advanced/corporation/faq.md?raw";
import file9 from "./doc/advanced/corporation/financial-statement.md?raw";
import file10 from "./doc/advanced/corporation/general-advice.md?raw";
import file11 from "./doc/advanced/corporation/industry-supply-chain.md?raw";
import file12 from "./doc/advanced/corporation/miscellany.md?raw";
import file13 from "./doc/advanced/corporation/office.md?raw";
import file14 from "./doc/advanced/corporation/optimal-selling-price-market-ta2.md?raw";
import file15 from "./doc/advanced/corporation/product.md?raw";
import file16 from "./doc/advanced/corporation/quality.md?raw";
import file17 from "./doc/advanced/corporation/smart-supply.md?raw";
import file18 from "./doc/advanced/corporation/unlocks-upgrade-research.md?raw";
import file19 from "./doc/advanced/corporation/warehouse.md?raw";
import file20 from "./doc/advanced/corporation/wilson-analytics-advert.md?raw";
import file21 from "./doc/advanced/corporations.md?raw";
import file22 from "./doc/advanced/faction_list.md?raw";
import file23 from "./doc/advanced/gang.md?raw";
import file24 from "./doc/advanced/grafting.md?raw";
import file25 from "./doc/advanced/hacknetservers.md?raw";
import file26 from "./doc/advanced/intelligence.md?raw";
import file27 from "./doc/advanced/offlineandbonustime.md?raw";
import file28 from "./doc/advanced/sleeves.md?raw";
import file29 from "./doc/advanced/sourcefiles.md?raw";
import file30 from "./doc/advanced/stanek.md?raw";
import file31 from "./doc/basic/augmentations.md?raw";
import file32 from "./doc/basic/autocomplete.md?raw";
import file33 from "./doc/basic/codingcontracts.md?raw";
import file34 from "./doc/basic/companies.md?raw";
import file35 from "./doc/basic/crimes.md?raw";
import file36 from "./doc/basic/factions.md?raw";
import file37 from "./doc/basic/hacking.md?raw";
import file38 from "./doc/basic/hacknet_nodes.md?raw";
import file39 from "./doc/basic/infiltration.md?raw";
import file40 from "./doc/basic/programs.md?raw";
import file41 from "./doc/basic/ram.md?raw";
import file42 from "./doc/basic/reputation.md?raw";
import file43 from "./doc/basic/scripts.md?raw";
import file44 from "./doc/basic/servers.md?raw";
import file45 from "./doc/basic/stats.md?raw";
import file46 from "./doc/basic/stockmarket.md?raw";
import file47 from "./doc/basic/terminal.md?raw";
import file48 from "./doc/basic/world.md?raw";
import file49 from "./doc/changelog-v0.md?raw";
import file50 from "./doc/changelog-v1.md?raw";
import file51 from "./doc/changelog.md?raw";
import file52 from "./doc/help/getting_started.md?raw";
import file53 from "./doc/help/tools_and_resources.md?raw";
import file54 from "./doc/index.md?raw";
import file55 from "./doc/migrations/ns2.md?raw";
import file56 from "./doc/migrations/v1.md?raw";
import file57 from "./doc/migrations/v2.md?raw";
import file58 from "./doc/programming/game_frozen.md?raw";
import file59 from "./doc/programming/go_algorithms.md?raw";
import file60 from "./doc/programming/hackingalgorithms.md?raw";
import file61 from "./doc/programming/learn.md?raw";
import file62 from "./doc/programming/react.md?raw";
import file63 from "./doc/programming/remote_api.md?raw";
import file0 from "./doc/en/advanced/bitnode_recommendation_comprehensive_guide.md?raw";
import file1 from "./doc/en/advanced/bitnode_recommendation_short_guide.md?raw";
import file2 from "./doc/en/advanced/bitnodes.md?raw";
import file3 from "./doc/en/advanced/bladeburners.md?raw";
import file4 from "./doc/en/advanced/corporation/basic-gameplay-and-term.md?raw";
import file5 from "./doc/en/advanced/corporation/boost-material.md?raw";
import file6 from "./doc/en/advanced/corporation/demand-competition.md?raw";
import file7 from "./doc/en/advanced/corporation/division-raw-production.md?raw";
import file8 from "./doc/en/advanced/corporation/faq.md?raw";
import file9 from "./doc/en/advanced/corporation/financial-statement.md?raw";
import file10 from "./doc/en/advanced/corporation/general-advice.md?raw";
import file11 from "./doc/en/advanced/corporation/industry-supply-chain.md?raw";
import file12 from "./doc/en/advanced/corporation/miscellany.md?raw";
import file13 from "./doc/en/advanced/corporation/office.md?raw";
import file14 from "./doc/en/advanced/corporation/optimal-selling-price-market-ta2.md?raw";
import file15 from "./doc/en/advanced/corporation/product.md?raw";
import file16 from "./doc/en/advanced/corporation/quality.md?raw";
import file17 from "./doc/en/advanced/corporation/smart-supply.md?raw";
import file18 from "./doc/en/advanced/corporation/unlocks-upgrade-research.md?raw";
import file19 from "./doc/en/advanced/corporation/warehouse.md?raw";
import file20 from "./doc/en/advanced/corporation/wilson-analytics-advert.md?raw";
import file21 from "./doc/en/advanced/corporations.md?raw";
import file22 from "./doc/en/advanced/faction_list.md?raw";
import file23 from "./doc/en/advanced/gang.md?raw";
import file24 from "./doc/en/advanced/grafting.md?raw";
import file25 from "./doc/en/advanced/hacknetservers.md?raw";
import file26 from "./doc/en/advanced/intelligence.md?raw";
import file27 from "./doc/en/advanced/offlineandbonustime.md?raw";
import file28 from "./doc/en/advanced/sleeves.md?raw";
import file29 from "./doc/en/advanced/sourcefiles.md?raw";
import file30 from "./doc/en/advanced/stanek.md?raw";
import file31 from "./doc/en/basic/augmentations.md?raw";
import file32 from "./doc/en/basic/autocomplete.md?raw";
import file33 from "./doc/en/basic/codingcontracts.md?raw";
import file34 from "./doc/en/basic/companies.md?raw";
import file35 from "./doc/en/basic/crimes.md?raw";
import file36 from "./doc/en/basic/factions.md?raw";
import file37 from "./doc/en/basic/hacking.md?raw";
import file38 from "./doc/en/basic/hacknet_nodes.md?raw";
import file39 from "./doc/en/basic/infiltration.md?raw";
import file40 from "./doc/en/basic/programs.md?raw";
import file41 from "./doc/en/basic/ram.md?raw";
import file42 from "./doc/en/basic/reputation.md?raw";
import file43 from "./doc/en/basic/scripts.md?raw";
import file44 from "./doc/en/basic/servers.md?raw";
import file45 from "./doc/en/basic/stats.md?raw";
import file46 from "./doc/en/basic/stockmarket.md?raw";
import file47 from "./doc/en/basic/terminal.md?raw";
import file48 from "./doc/en/basic/world.md?raw";
import file49 from "./doc/en/changelog-v0.md?raw";
import file50 from "./doc/en/changelog-v1.md?raw";
import file51 from "./doc/en/changelog.md?raw";
import file52 from "./doc/en/help/getting_started.md?raw";
import file53 from "./doc/en/help/tools_and_resources.md?raw";
import file54 from "./doc/en/index.md?raw";
import file55 from "./doc/en/migrations/ns2.md?raw";
import file56 from "./doc/en/migrations/v1.md?raw";
import file57 from "./doc/en/migrations/v2.md?raw";
import file58 from "./doc/en/programming/game_frozen.md?raw";
import file59 from "./doc/en/programming/go_algorithms.md?raw";
import file60 from "./doc/en/programming/hackingalgorithms.md?raw";
import file61 from "./doc/en/programming/learn.md?raw";
import file62 from "./doc/en/programming/react.md?raw";
import file63 from "./doc/en/programming/remote_api.md?raw";
import nsDoc_bitburner__valueof_md from "../../markdown/bitburner._valueof.md?raw";
import nsDoc_bitburner_activefragment_highestcharge_md from "../../markdown/bitburner.activefragment.highestcharge.md?raw";
import nsDoc_bitburner_activefragment_id_md from "../../markdown/bitburner.activefragment.id.md?raw";
@@ -1498,70 +1498,70 @@ import nsDoc_bitburner_workstats_strexp_md from "../../markdown/bitburner.workst
import nsDoc_index_md from "../../markdown/index.md?raw";
export const AllPages: Record<string, string> = {};
AllPages["advanced/bitnode_recommendation_comprehensive_guide.md"] = file0;
AllPages["advanced/bitnode_recommendation_short_guide.md"] = file1;
AllPages["advanced/bitnodes.md"] = file2;
AllPages["advanced/bladeburners.md"] = file3;
AllPages["advanced/corporation/basic-gameplay-and-term.md"] = file4;
AllPages["advanced/corporation/boost-material.md"] = file5;
AllPages["advanced/corporation/demand-competition.md"] = file6;
AllPages["advanced/corporation/division-raw-production.md"] = file7;
AllPages["advanced/corporation/faq.md"] = file8;
AllPages["advanced/corporation/financial-statement.md"] = file9;
AllPages["advanced/corporation/general-advice.md"] = file10;
AllPages["advanced/corporation/industry-supply-chain.md"] = file11;
AllPages["advanced/corporation/miscellany.md"] = file12;
AllPages["advanced/corporation/office.md"] = file13;
AllPages["advanced/corporation/optimal-selling-price-market-ta2.md"] = file14;
AllPages["advanced/corporation/product.md"] = file15;
AllPages["advanced/corporation/quality.md"] = file16;
AllPages["advanced/corporation/smart-supply.md"] = file17;
AllPages["advanced/corporation/unlocks-upgrade-research.md"] = file18;
AllPages["advanced/corporation/warehouse.md"] = file19;
AllPages["advanced/corporation/wilson-analytics-advert.md"] = file20;
AllPages["advanced/corporations.md"] = file21;
AllPages["advanced/faction_list.md"] = file22;
AllPages["advanced/gang.md"] = file23;
AllPages["advanced/grafting.md"] = file24;
AllPages["advanced/hacknetservers.md"] = file25;
AllPages["advanced/intelligence.md"] = file26;
AllPages["advanced/offlineandbonustime.md"] = file27;
AllPages["advanced/sleeves.md"] = file28;
AllPages["advanced/sourcefiles.md"] = file29;
AllPages["advanced/stanek.md"] = file30;
AllPages["basic/augmentations.md"] = file31;
AllPages["basic/autocomplete.md"] = file32;
AllPages["basic/codingcontracts.md"] = file33;
AllPages["basic/companies.md"] = file34;
AllPages["basic/crimes.md"] = file35;
AllPages["basic/factions.md"] = file36;
AllPages["basic/hacking.md"] = file37;
AllPages["basic/hacknet_nodes.md"] = file38;
AllPages["basic/infiltration.md"] = file39;
AllPages["basic/programs.md"] = file40;
AllPages["basic/ram.md"] = file41;
AllPages["basic/reputation.md"] = file42;
AllPages["basic/scripts.md"] = file43;
AllPages["basic/servers.md"] = file44;
AllPages["basic/stats.md"] = file45;
AllPages["basic/stockmarket.md"] = file46;
AllPages["basic/terminal.md"] = file47;
AllPages["basic/world.md"] = file48;
AllPages["changelog-v0.md"] = file49;
AllPages["changelog-v1.md"] = file50;
AllPages["changelog.md"] = file51;
AllPages["help/getting_started.md"] = file52;
AllPages["help/tools_and_resources.md"] = file53;
AllPages["index.md"] = file54;
AllPages["migrations/ns2.md"] = file55;
AllPages["migrations/v1.md"] = file56;
AllPages["migrations/v2.md"] = file57;
AllPages["programming/game_frozen.md"] = file58;
AllPages["programming/go_algorithms.md"] = file59;
AllPages["programming/hackingalgorithms.md"] = file60;
AllPages["programming/learn.md"] = file61;
AllPages["programming/react.md"] = file62;
AllPages["programming/remote_api.md"] = file63;
AllPages["en/advanced/bitnode_recommendation_comprehensive_guide.md"] = file0;
AllPages["en/advanced/bitnode_recommendation_short_guide.md"] = file1;
AllPages["en/advanced/bitnodes.md"] = file2;
AllPages["en/advanced/bladeburners.md"] = file3;
AllPages["en/advanced/corporation/basic-gameplay-and-term.md"] = file4;
AllPages["en/advanced/corporation/boost-material.md"] = file5;
AllPages["en/advanced/corporation/demand-competition.md"] = file6;
AllPages["en/advanced/corporation/division-raw-production.md"] = file7;
AllPages["en/advanced/corporation/faq.md"] = file8;
AllPages["en/advanced/corporation/financial-statement.md"] = file9;
AllPages["en/advanced/corporation/general-advice.md"] = file10;
AllPages["en/advanced/corporation/industry-supply-chain.md"] = file11;
AllPages["en/advanced/corporation/miscellany.md"] = file12;
AllPages["en/advanced/corporation/office.md"] = file13;
AllPages["en/advanced/corporation/optimal-selling-price-market-ta2.md"] = file14;
AllPages["en/advanced/corporation/product.md"] = file15;
AllPages["en/advanced/corporation/quality.md"] = file16;
AllPages["en/advanced/corporation/smart-supply.md"] = file17;
AllPages["en/advanced/corporation/unlocks-upgrade-research.md"] = file18;
AllPages["en/advanced/corporation/warehouse.md"] = file19;
AllPages["en/advanced/corporation/wilson-analytics-advert.md"] = file20;
AllPages["en/advanced/corporations.md"] = file21;
AllPages["en/advanced/faction_list.md"] = file22;
AllPages["en/advanced/gang.md"] = file23;
AllPages["en/advanced/grafting.md"] = file24;
AllPages["en/advanced/hacknetservers.md"] = file25;
AllPages["en/advanced/intelligence.md"] = file26;
AllPages["en/advanced/offlineandbonustime.md"] = file27;
AllPages["en/advanced/sleeves.md"] = file28;
AllPages["en/advanced/sourcefiles.md"] = file29;
AllPages["en/advanced/stanek.md"] = file30;
AllPages["en/basic/augmentations.md"] = file31;
AllPages["en/basic/autocomplete.md"] = file32;
AllPages["en/basic/codingcontracts.md"] = file33;
AllPages["en/basic/companies.md"] = file34;
AllPages["en/basic/crimes.md"] = file35;
AllPages["en/basic/factions.md"] = file36;
AllPages["en/basic/hacking.md"] = file37;
AllPages["en/basic/hacknet_nodes.md"] = file38;
AllPages["en/basic/infiltration.md"] = file39;
AllPages["en/basic/programs.md"] = file40;
AllPages["en/basic/ram.md"] = file41;
AllPages["en/basic/reputation.md"] = file42;
AllPages["en/basic/scripts.md"] = file43;
AllPages["en/basic/servers.md"] = file44;
AllPages["en/basic/stats.md"] = file45;
AllPages["en/basic/stockmarket.md"] = file46;
AllPages["en/basic/terminal.md"] = file47;
AllPages["en/basic/world.md"] = file48;
AllPages["en/changelog-v0.md"] = file49;
AllPages["en/changelog-v1.md"] = file50;
AllPages["en/changelog.md"] = file51;
AllPages["en/help/getting_started.md"] = file52;
AllPages["en/help/tools_and_resources.md"] = file53;
AllPages["en/index.md"] = file54;
AllPages["en/migrations/ns2.md"] = file55;
AllPages["en/migrations/v1.md"] = file56;
AllPages["en/migrations/v2.md"] = file57;
AllPages["en/programming/game_frozen.md"] = file58;
AllPages["en/programming/go_algorithms.md"] = file59;
AllPages["en/programming/hackingalgorithms.md"] = file60;
AllPages["en/programming/learn.md"] = file61;
AllPages["en/programming/react.md"] = file62;
AllPages["en/programming/remote_api.md"] = file63;
AllPages["nsDoc/bitburner._valueof.md"] = nsDoc_bitburner__valueof_md;
AllPages["nsDoc/bitburner.activefragment.highestcharge.md"] = nsDoc_bitburner_activefragment_highestcharge_md;
AllPages["nsDoc/bitburner.activefragment.id.md"] = nsDoc_bitburner_activefragment_id_md;

View File

@@ -2,7 +2,18 @@ import { AllPages } from "./pages";
import { EventEmitter } from "../utils/EventEmitter";
export const getPage = (title: string): string => {
const pageContent = AllPages[title];
const lang = new Intl.Locale(navigator.language).language;
const fallbackLang = "en"; // For untranslated languages
let pageContent = null;
if (!title.startsWith("nsDoc")) {
pageContent = AllPages[lang + "/" + title];
if (pageContent == null) {
pageContent = AllPages[fallbackLang + "/" + title];
}
}
if (pageContent == null) {
pageContent = AllPages[title];
}
if (pageContent == null) {
const errorMessage = `Cannot find ${title} page.`;
console.error(errorMessage);

View File

@@ -50,7 +50,7 @@ export const RemoteAPIPage = (): React.ReactElement => {
</Typography>
<Typography>
<Link
href="https://github.com/bitburner-official/bitburner-src/blob/stable/src/Documentation/doc/programming/remote_api.md"
href="https://github.com/bitburner-official/bitburner-src/blob/stable/src/Documentation/doc/en/programming/remote_api.md"
target="_blank"
>
Documentation

View File

@@ -52,7 +52,7 @@ export const p = (props: React.PropsWithChildren<object>): React.ReactElement =>
* - Other pages: Home > bitburner > something
*
* The "Home" button (index.md) is useless. It's also confusing because we have a custom "Home" button linking to
* src\Documentation\doc\index.md. If we want to customize this "header", we have to customize api-documenter, which
* src/Documentation/doc/en/index.md. If we want to customize this "header", we have to customize api-documenter, which
* is a complicated task. In order to remove the useless "Home" link, it's easier to check the content of
* props.children like this. It's not ideal, but it does the job well.
*/

View File

@@ -24,7 +24,7 @@ const defaultPage = asFilePath("index.md");
export const defaultNsApiPage = asFilePath("nsDoc/bitburner.ns.md");
/**
* If we move or rename "bitburner.ns.md", we must update this constant, "defaultNsApiPage", "openDocExternally", and
* the URL in src\Documentation\doc\index.md.
* the URL in src/Documentation/doc/en/index.md.
*/
export const externalUrlOfNsApiPage =
"https://github.com/bitburner-official/bitburner-src/blob/stable/markdown/bitburner.ns.md";

View File

@@ -22,7 +22,7 @@ export const V2Modal = (): React.ReactElement => {
You should also take a look at{" "}
<a
target="_"
href="https://github.com/bitburner-official/bitburner-src/blob/stable/src/Documentation/doc/migrations/v2.md"
href="https://github.com/bitburner-official/bitburner-src/blob/stable/src/Documentation/doc/en/migrations/v2.md"
>
{" "}
the migration guide
@@ -30,7 +30,7 @@ export const V2Modal = (): React.ReactElement => {
as well as{" "}
<a
target="_"
href="https://github.com/bitburner-official/bitburner-src/blob/stable/src/Documentation/doc/changelog.md"
href="https://github.com/bitburner-official/bitburner-src/blob/stable/src/Documentation/doc/en/changelog.md"
>
the changelog
</a>