From a2c079f7218f8b946f8db819fc15169131a7c6f8 Mon Sep 17 00:00:00 2001 From: alexgeron-luos Date: Wed, 9 Nov 2022 14:23:34 +0100 Subject: [PATCH 1/3] fix nav button --- sidebarsTutorials.js | 90 +++++++++---------- .../school/index/data/dataIntro.json | 6 +- src/theme/DocItem/index.js | 15 +++- tutorials/bike-alarm/bike-alarm.mdx | 2 + tutorials/esp/esp.mdx | 2 + tutorials/get-started/get-started.mdx | 4 +- tutorials/get-started/get-started2.mdx | 1 + tutorials/luos-integration/install-ros2.mdx | 2 + tutorials/morse/morse.mdx | 2 + tutorials/pio/pio.mdx | 2 + .../your-first-detection.mdx | 2 + .../your-first-message/your-first-message.mdx | 2 + .../your-first-service/your-first-service.mdx | 2 + 13 files changed, 82 insertions(+), 50 deletions(-) diff --git a/sidebarsTutorials.js b/sidebarsTutorials.js index 7df147f47..fed9c7d26 100644 --- a/sidebarsTutorials.js +++ b/sidebarsTutorials.js @@ -16,11 +16,11 @@ module.exports = { label: 'Get started', link: { type: 'doc', id: 'get-started/get-started' }, items: [ - // { - // type: 'doc', - // label: 'Your first project', - // id: 'get-started/get-started', - // }, + { + type: 'doc', + label: 'Your first project', + id: 'get-started/get-started', + }, { type: 'doc', label: 'Take the control', @@ -43,11 +43,11 @@ module.exports = { label: 'First service', link: { type: 'doc', id: 'your-first-service/your-first-service' }, items: [ - // { - // type: 'doc', - // label: 'Create a service', - // id: 'your-first-service/your-first-service', - // }, + { + type: 'doc', + label: 'Create a service', + id: 'your-first-service/your-first-service', + }, { type: 'doc', label: 'Create a package', @@ -60,11 +60,11 @@ module.exports = { label: 'First message', link: { type: 'doc', id: 'your-first-message/your-first-message' }, items: [ - // { - // type: 'doc', - // label: 'Receive a message', - // id: 'your-first-message/your-first-message', - // }, + { + type: 'doc', + label: 'Receive a message', + id: 'your-first-message/your-first-message', + }, { type: 'doc', label: 'Send a message', @@ -77,11 +77,11 @@ module.exports = { label: 'First detection', link: { type: 'doc', id: 'your-first-detection/your-first-detection' }, items: [ - // { - // type: 'doc', - // label: 'The topology', - // id: 'your-first-detection/your-first-detection', - // }, + { + type: 'doc', + label: 'The topology', + id: 'your-first-detection/your-first-detection', + }, { type: 'doc', label: 'The routing table', @@ -117,11 +117,11 @@ module.exports = { label: 'PlatformIO', link: { type: 'doc', id: 'pio/pio' }, items: [ - // { - // type: 'doc', - // label: 'Create your project', - // id: 'pio/pio', - // }, + { + type: 'doc', + label: 'Create your project', + id: 'pio/pio', + }, { type: 'doc', label: 'Include Luos', @@ -139,11 +139,11 @@ module.exports = { label: 'Espressif IDE', link: { type: 'doc', id: 'esp/esp' }, items: [ - // { - // type: 'doc', - // label: 'Set the environnement', - // id: 'esp/esp', - // }, + { + type: 'doc', + label: 'Set the environnement', + id: 'esp/esp', + }, { type: 'doc', label: 'Connect ESP to network', @@ -164,11 +164,11 @@ module.exports = { id: 'luos-integration/install-ros2', }, items: [ - // { - // type: 'doc', - // label: 'Install ROS 2', - // id: 'luos-integration/install-ros2', - // }, + { + type: 'doc', + label: 'Install ROS 2', + id: 'luos-integration/install-ros2', + }, { type: 'doc', label: 'ROS 2 package example', @@ -194,11 +194,11 @@ module.exports = { label: 'Morse encoder', link: { type: 'doc', id: 'morse/morse' }, items: [ - // { - // type: 'doc', - // label: 'The algorithm', - // id: 'morse/morse', - // }, + { + type: 'doc', + label: 'The algorithm', + id: 'morse/morse', + }, { type: 'doc', label: 'Display encoder output', @@ -216,11 +216,11 @@ module.exports = { label: 'Connected bike alarm', link: { type: 'doc', id: 'bike-alarm/bike-alarm' }, items: [ - // { - // type: 'doc', - // label: 'Make a basic alarm', - // id: 'bike-alarm/bike-alarm', - // }, + { + type: 'doc', + label: 'Make a basic alarm', + id: 'bike-alarm/bike-alarm', + }, { type: 'doc', label: 'Make this alarm modular', diff --git a/src/components/school/index/data/dataIntro.json b/src/components/school/index/data/dataIntro.json index b2a1f4083..59d1e8a9f 100644 --- a/src/components/school/index/data/dataIntro.json +++ b/src/components/school/index/data/dataIntro.json @@ -44,7 +44,7 @@ "img": "Your_first_message_Luos", "desc": "Luos aim to exchange information between services by sending messages. In this tutorial we will learn the message structure and how to send it to another services.", "tags": ["Luos Message", "Service", "Polling", "Message Handler"], - "link": "your-first-message", + "link": "/tutorials/your-first-message", "author": "nicoC" }, { @@ -68,7 +68,7 @@ "img": "Luos_and_Arduino", "desc": "In this tutorial, you will how to set up a Luos-Arduino project on Arduino IDE.", "tags": ["Board", "MCU", "Service", "Network", "Distributed System"], - "link": "/tutorials/arduino/intro", + "link": "/tutorials/arduino", "author": "nicoR" }, { @@ -80,7 +80,7 @@ "img": "Bootloader_Luos", "desc": "In this tutorial, you will learn to use the bootloader feature offered by Luos technology.", "tags": ["Board", "MCU", "Service", "Network", "Distributed System"], - "link": "/tutorials/bootloader/intro", + "link": "/tutorials/bootloader", "author": "thomas" }, { diff --git a/src/theme/DocItem/index.js b/src/theme/DocItem/index.js index c26afc432..9317cfa87 100644 --- a/src/theme/DocItem/index.js +++ b/src/theme/DocItem/index.js @@ -59,6 +59,19 @@ function DocItemContent(props) { const regex = /tutorials/g; const found = permalink.match(regex); + + let next = { + permalink: metadata.next.permalink, + title: metadata.next.title, + }; + + if (metadata.frontMatter.nextUrl) { + next = { + permalink: metadata.frontMatter.nextUrl, + title: metadata.frontMatter.nextTitle, + }; + } + return (
- +
{renderTocDesktop && ( diff --git a/tutorials/bike-alarm/bike-alarm.mdx b/tutorials/bike-alarm/bike-alarm.mdx index cd195e7cb..6cb019c6d 100644 --- a/tutorials/bike-alarm/bike-alarm.mdx +++ b/tutorials/bike-alarm/bike-alarm.mdx @@ -4,6 +4,8 @@ hide_title: true title: Develop a connected bike alarm image: /assets/images/Bike-alarm-Luos.png description: The purpose of the bike alarm is to create an alarm that continuously measures the movements of a bike. +nextUrl: /tutorials/bike-alarm/adaptable-alarm +nextTitle: 'Make this alarm modular' --- import Image from '@site/src/components/Image'; diff --git a/tutorials/esp/esp.mdx b/tutorials/esp/esp.mdx index 84718bc7f..5dc056c00 100644 --- a/tutorials/esp/esp.mdx +++ b/tutorials/esp/esp.mdx @@ -2,6 +2,8 @@ custom_edit_url: null title: 'Luos with ESP32: ESP IDF and Espressif IDE Setup' hide_title: true +nextUrl: /tutorials/esp/connect +nextTitle: 'Connect ESP to network' --- import Image from '@site/src/components/Image'; diff --git a/tutorials/get-started/get-started.mdx b/tutorials/get-started/get-started.mdx index afac811ea..527c79528 100644 --- a/tutorials/get-started/get-started.mdx +++ b/tutorials/get-started/get-started.mdx @@ -4,6 +4,8 @@ hide_title: true title: 'Get started Part 1: set up your project' image: /assets/images/tutorials/get-started/Get-Started-Part-1-banner-Luos.png description: This part will guide you through the basic essential tools' installation and how to use them. +nextUrl: /tutorials/get-started/get-started2 +nextTitle: 'Part 2: take the control' --- import Image from '@site/src/components/Image'; @@ -165,7 +167,7 @@ Congratulations, your first Luos app is running! -When you build your application, an executable program is generated. Run the application that you just built by going in the folder *Get_started\No-Board\.pio\build\native* and launch *program.exe*. +When you build your application, an executable program is generated. Run the application that you just built by going in the folder _Get_started\No-Board\.pio\build\native_ and launch _program.exe_. In a terminal, you should see the program runing an the "LED" blinking. Date: Wed, 9 Nov 2022 14:49:18 +0100 Subject: [PATCH 2/3] fix build --- src/theme/DocItem/index.js | 4 +-- src/theme/DocPaginator/index.js | 44 +++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+), 2 deletions(-) create mode 100644 src/theme/DocPaginator/index.js diff --git a/src/theme/DocItem/index.js b/src/theme/DocItem/index.js index 9317cfa87..bc4aa0e38 100644 --- a/src/theme/DocItem/index.js +++ b/src/theme/DocItem/index.js @@ -61,8 +61,8 @@ function DocItemContent(props) { const found = permalink.match(regex); let next = { - permalink: metadata.next.permalink, - title: metadata.next.title, + permalink: metadata.next ? metadata.next.permalink : null, + title: metadata.next ? metadata.next.title : null, }; if (metadata.frontMatter.nextUrl) { diff --git a/src/theme/DocPaginator/index.js b/src/theme/DocPaginator/index.js new file mode 100644 index 000000000..d5a4d6a70 --- /dev/null +++ b/src/theme/DocPaginator/index.js @@ -0,0 +1,44 @@ +import React from 'react'; +import Translate, { translate } from '@docusaurus/Translate'; +import PaginatorNavLink from '@theme/PaginatorNavLink'; +export default function DocPaginator(props) { + const { previous, next } = props; + return ( + + ); +} From 98a797d5750978dbe7b0250adcf499df82cb21ff Mon Sep 17 00:00:00 2001 From: alexgeron-luos Date: Thu, 10 Nov 2022 11:46:59 +0100 Subject: [PATCH 3/3] remove category links in sidebar --- sidebarsTutorials.js | 12 ----- src/theme/DocItem/index.js | 14 +----- src/theme/DocPaginator/index.js | 44 ------------------- tutorials/bike-alarm/bike-alarm.mdx | 2 - tutorials/esp/esp.mdx | 2 - tutorials/get-started/get-started.mdx | 2 - tutorials/luos-integration/install-ros2.mdx | 2 - tutorials/morse/morse.mdx | 2 - tutorials/pio/pio.mdx | 2 - .../your-first-detection.mdx | 2 - .../your-first-message/your-first-message.mdx | 2 - .../your-first-service/your-first-service.mdx | 2 - 12 files changed, 1 insertion(+), 87 deletions(-) delete mode 100644 src/theme/DocPaginator/index.js diff --git a/sidebarsTutorials.js b/sidebarsTutorials.js index fed9c7d26..4c0e3b70f 100644 --- a/sidebarsTutorials.js +++ b/sidebarsTutorials.js @@ -14,7 +14,6 @@ module.exports = { { type: 'category', label: 'Get started', - link: { type: 'doc', id: 'get-started/get-started' }, items: [ { type: 'doc', @@ -41,7 +40,6 @@ module.exports = { { type: 'category', label: 'First service', - link: { type: 'doc', id: 'your-first-service/your-first-service' }, items: [ { type: 'doc', @@ -58,7 +56,6 @@ module.exports = { { type: 'category', label: 'First message', - link: { type: 'doc', id: 'your-first-message/your-first-message' }, items: [ { type: 'doc', @@ -75,7 +72,6 @@ module.exports = { { type: 'category', label: 'First detection', - link: { type: 'doc', id: 'your-first-detection/your-first-detection' }, items: [ { type: 'doc', @@ -115,7 +111,6 @@ module.exports = { { type: 'category', label: 'PlatformIO', - link: { type: 'doc', id: 'pio/pio' }, items: [ { type: 'doc', @@ -137,7 +132,6 @@ module.exports = { { type: 'category', label: 'Espressif IDE', - link: { type: 'doc', id: 'esp/esp' }, items: [ { type: 'doc', @@ -159,10 +153,6 @@ module.exports = { { type: 'category', label: 'ROS 1&2', - link: { - type: 'doc', - id: 'luos-integration/install-ros2', - }, items: [ { type: 'doc', @@ -192,7 +182,6 @@ module.exports = { { type: 'category', label: 'Morse encoder', - link: { type: 'doc', id: 'morse/morse' }, items: [ { type: 'doc', @@ -214,7 +203,6 @@ module.exports = { { type: 'category', label: 'Connected bike alarm', - link: { type: 'doc', id: 'bike-alarm/bike-alarm' }, items: [ { type: 'doc', diff --git a/src/theme/DocItem/index.js b/src/theme/DocItem/index.js index bc4aa0e38..d8cfe2aa2 100644 --- a/src/theme/DocItem/index.js +++ b/src/theme/DocItem/index.js @@ -60,18 +60,6 @@ function DocItemContent(props) { const regex = /tutorials/g; const found = permalink.match(regex); - let next = { - permalink: metadata.next ? metadata.next.permalink : null, - title: metadata.next ? metadata.next.title : null, - }; - - if (metadata.frontMatter.nextUrl) { - next = { - permalink: metadata.frontMatter.nextUrl, - title: metadata.frontMatter.nextTitle, - }; - } - return (
- +
{renderTocDesktop && ( diff --git a/src/theme/DocPaginator/index.js b/src/theme/DocPaginator/index.js deleted file mode 100644 index d5a4d6a70..000000000 --- a/src/theme/DocPaginator/index.js +++ /dev/null @@ -1,44 +0,0 @@ -import React from 'react'; -import Translate, { translate } from '@docusaurus/Translate'; -import PaginatorNavLink from '@theme/PaginatorNavLink'; -export default function DocPaginator(props) { - const { previous, next } = props; - return ( - - ); -} diff --git a/tutorials/bike-alarm/bike-alarm.mdx b/tutorials/bike-alarm/bike-alarm.mdx index 6cb019c6d..cd195e7cb 100644 --- a/tutorials/bike-alarm/bike-alarm.mdx +++ b/tutorials/bike-alarm/bike-alarm.mdx @@ -4,8 +4,6 @@ hide_title: true title: Develop a connected bike alarm image: /assets/images/Bike-alarm-Luos.png description: The purpose of the bike alarm is to create an alarm that continuously measures the movements of a bike. -nextUrl: /tutorials/bike-alarm/adaptable-alarm -nextTitle: 'Make this alarm modular' --- import Image from '@site/src/components/Image'; diff --git a/tutorials/esp/esp.mdx b/tutorials/esp/esp.mdx index 5dc056c00..84718bc7f 100644 --- a/tutorials/esp/esp.mdx +++ b/tutorials/esp/esp.mdx @@ -2,8 +2,6 @@ custom_edit_url: null title: 'Luos with ESP32: ESP IDF and Espressif IDE Setup' hide_title: true -nextUrl: /tutorials/esp/connect -nextTitle: 'Connect ESP to network' --- import Image from '@site/src/components/Image'; diff --git a/tutorials/get-started/get-started.mdx b/tutorials/get-started/get-started.mdx index 527c79528..ec7862875 100644 --- a/tutorials/get-started/get-started.mdx +++ b/tutorials/get-started/get-started.mdx @@ -4,8 +4,6 @@ hide_title: true title: 'Get started Part 1: set up your project' image: /assets/images/tutorials/get-started/Get-Started-Part-1-banner-Luos.png description: This part will guide you through the basic essential tools' installation and how to use them. -nextUrl: /tutorials/get-started/get-started2 -nextTitle: 'Part 2: take the control' --- import Image from '@site/src/components/Image'; diff --git a/tutorials/luos-integration/install-ros2.mdx b/tutorials/luos-integration/install-ros2.mdx index ed803cc22..2a6fd8850 100644 --- a/tutorials/luos-integration/install-ros2.mdx +++ b/tutorials/luos-integration/install-ros2.mdx @@ -3,8 +3,6 @@ title: How to use Luos engine with ROS hide_title: true custom_edit_url: null image: /assets/images/luos-integrations-install-ros-2-banner.png -nextUrl: /tutorials/luos-integration/ros2-package-example -nextTitle: 'ROS 2 package example' --- import IconExternalLink from '@theme/Icon/ExternalLink'; diff --git a/tutorials/morse/morse.mdx b/tutorials/morse/morse.mdx index c977ff7d2..517e70706 100644 --- a/tutorials/morse/morse.mdx +++ b/tutorials/morse/morse.mdx @@ -4,8 +4,6 @@ hide_title: true custom_edit_url: null image: /assets/images/Morse_encoder_Luos.png description: The first step of this tutorial is to create the application service that will encode words into Morse signals. -nextUrl: /tutorials/morse/output -nextTitle: 'Display encoder output' --- import Image from '@site/src/components/Image'; diff --git a/tutorials/pio/pio.mdx b/tutorials/pio/pio.mdx index d39e0e194..1b2d3bad0 100644 --- a/tutorials/pio/pio.mdx +++ b/tutorials/pio/pio.mdx @@ -3,8 +3,6 @@ title: Create a Luos project with PlatformIO hide_title: true custom_edit_url: null description: We will guide you through the process! You will learn how to set up a PlatformIO environment and how to make a good project structure. -nextUrl: /tutorials/pio/include -nextTitle: 'Include Luos' --- import Image from '@site/src/components/Image'; diff --git a/tutorials/your-first-detection/your-first-detection.mdx b/tutorials/your-first-detection/your-first-detection.mdx index ea5bb3f88..e4d1185ab 100644 --- a/tutorials/your-first-detection/your-first-detection.mdx +++ b/tutorials/your-first-detection/your-first-detection.mdx @@ -4,8 +4,6 @@ hide_title: true custom_edit_url: null image: /assets/images/Your-first-topology-detection-banner-luos.png description: In the previous training, we created a LED and a button services to control them using Pyluos. -nextUrl: /tutorials/your-first-detection/routing-table -nextTitle: 'The routing table' --- import Image from '@site/src/components/Image'; diff --git a/tutorials/your-first-message/your-first-message.mdx b/tutorials/your-first-message/your-first-message.mdx index ec642a678..a0d855204 100644 --- a/tutorials/your-first-message/your-first-message.mdx +++ b/tutorials/your-first-message/your-first-message.mdx @@ -4,8 +4,6 @@ title: Your First Message hide_title: true image: /assets/images/tutorials/your-first-message-banner-luos.png description: A button can be represented (as a LED) by a state-type service. -nextUrl: /tutorials/your-first-message/send-message -nextTitle: 'Part 2: Send a message' --- import Image from '@site/src/components/Image'; diff --git a/tutorials/your-first-service/your-first-service.mdx b/tutorials/your-first-service/your-first-service.mdx index db74ff7c7..109a42902 100644 --- a/tutorials/your-first-service/your-first-service.mdx +++ b/tutorials/your-first-service/your-first-service.mdx @@ -4,8 +4,6 @@ hide_title: true custom_edit_url: null image: /assets/images/tutorials/your-first-service-banner-luos.png description: In the Get started tutorial, we learned to perform the following essential actions -nextUrl: /tutorials/your-first-service/create-a-package -nextTitle: 'Part 2: Create a package' --- import Image from '@site/src/components/Image';