Browse Source

Minor MkDocs fixes for 1.x compliance

Marcel Stör 5 years ago
parent
commit
186fcd7202
5 changed files with 10 additions and 10 deletions
  1. 1 1
      docs/en/index.md
  2. 0 0
      docs/en/lua-developer-faq.md
  3. 0 5
      docs/en/start.md
  4. 8 3
      docs/js/extra.js
  5. 1 1
      mkdocs.yml

+ 1 - 1
docs/en/index.md

@@ -2,7 +2,7 @@
 
 NodeMCU is an open source [Lua](https://www.lua.org/) based firmware for the [ESP8266 WiFi SOC from Espressif](http://espressif.com/en/products/esp8266/) and uses an on-module flash-based [SPIFFS](https://github.com/pellepl/spiffs) file system. NodeMCU is implemented in C and is layered on the [Espressif NON-OS SDK](https://github.com/espressif/ESP8266_NONOS_SDK).
 
-The firmware was initially developed as is a companion project to the popular ESP8266-based [NodeMCU development modules]((https://github.com/nodemcu/nodemcu-devkit-v1.0)), but the project is now community-supported, and the firmware can now be run on _any_ ESP module.
+The firmware was initially developed as is a companion project to the popular ESP8266-based [NodeMCU development modules](https://github.com/nodemcu/nodemcu-devkit-v1.0), but the project is now community-supported, and the firmware can now be run on _any_ ESP module.
 
 ## Programming Model
 The NodeMCU programming model is similar to that of [Node.js](https://en.wikipedia.org/wiki/Node.js), only in Lua. It is asynchronous and event-driven. Many functions, therefore, have parameters for callback functions. To give you an idea what a NodeMCU program looks like study the short snippets below. For more extensive examples have a look at the `/lua_examples` folder in the repository on GitHub.

File diff suppressed because it is too large
+ 0 - 0
docs/en/lua-developer-faq.md


+ 0 - 5
docs/en/start.md

@@ -1,5 +0,0 @@
-# Getting started
-## Obtain the firmware
-[Build the firmware](build.html) or download it from ?
-## Flash the firmware
-There are a number of tools for flashing the firmware.

+ 8 - 3
docs/js/extra.js

@@ -1,4 +1,5 @@
 var nodemcu = nodemcu || {};
+
 (function () {
   'use strict';
   //var languageCodeToNameMap = {en: 'English', de: 'Deutsch'};
@@ -112,7 +113,7 @@ var nodemcu = nodemcu || {};
    * replaces the relative path with an absolute path based on the selected branch.
    */
   function replaceRelativeLinksWithStaticGitHubUrl() {
-    var relativePath = "../../../..";
+    var relativePath = isOnRtd() ? "../../../.." : "../../..";
     var gitHubPath = "https://github.com/nodemcu/nodemcu-firmware/tree/" + determineSelectedBranch();
     var gitHubLinks = $("a[href^='" + relativePath + "']").each(function (index) {
       var url = $(this).attr('href');
@@ -148,7 +149,7 @@ var nodemcu = nodemcu || {};
    */
   function determineSelectedLanguageCode() {
     var selectedLanguageCode, path = window.location.pathname;
-    if (window.location.origin.indexOf('readthedocs') > -1) {
+    if (isOnRtd()) {
       // path is like /en/<branch>/<lang>/build/ -> extract 'lang'
       // split[0] is an '' because the path starts with the separator
       selectedLanguageCode = path.split('/')[3];
@@ -171,7 +172,7 @@ var nodemcu = nodemcu || {};
    */
   function determineSelectedBranch() {
     var branch = 'dev', path = window.location.pathname;
-    if (window.location.origin.indexOf('readthedocs') > -1) {
+    if (isOnRtd()) {
       // path is like /en/<branch>/<lang>/build/ -> extract 'lang'
       // split[0] is an '' because the path starts with the separator
       var thirdPathSegment = path.split('/')[2];
@@ -192,4 +193,8 @@ var nodemcu = nodemcu || {};
     }
     return values;
   }
+
+  function isOnRtd() {
+    return window.location.origin.indexOf('readthedocs') > -1;
+  }
 }());

+ 1 - 1
mkdocs.yml

@@ -19,7 +19,7 @@ extra_css:
 extra_javascript:
 - js/extra.js
 
-pages:
+nav:
 - Overview: 'index.md'
 - English:
     - Home: 'en/index.md'

Some files were not shown because too many files changed in this diff