Skip to content

Update lime-docs for downloading docs from the new website#1248

Closed
ilario wants to merge 3 commits intolibremesh:masterfrom
ilario:lime-docs
Closed

Update lime-docs for downloading docs from the new website#1248
ilario wants to merge 3 commits intolibremesh:masterfrom
ilario:lime-docs

Conversation

@ilario
Copy link
Copy Markdown
Member

@ilario ilario commented Mar 25, 2026

As approved in a meeting on the 7th of March, the website has been completely restructured by @a-gave and now it looks much better :D
As a result, the files fetched by the lime-docs package moved and it needs to be updated for avoiding compilation errors.
Also, I removed the lime-docs-it with the Italian documentation, as it was pretty much abandoned.

@ilario ilario requested a review from a-gave March 25, 2026 08:53
@a-gave
Copy link
Copy Markdown
Contributor

a-gave commented Mar 26, 2026

Thanks!!
The documentation files now in markdown should be converted to .txt to be visible via web at https://thisnode.info/docs, probably using $(FIND) in the Package/lime-docs/install is a viable option. Otherwise, browsers will make you download the file instead of viewing it via web.

@ilario
Copy link
Copy Markdown
Member Author

ilario commented Mar 27, 2026

The documentation files now in markdown should be converted to .txt to be visible via web at https://thisnode.info/docs, probably using $(FIND) in the Package/lime-docs/install is a viable option. Otherwise, browsers will make you download the file instead of viewing it via web.

Well thought!
I didn't consider that...
I tried with find, but I did not have time to test yet. Please test before merging.
In the current version, the directory structure gets destroyed, so if two files have the same filename, only one will be copied.
All the -print0, the \000 and the -0 are for using a null character as separator, so that filenames with spaces should be supported.

@a-gave
Copy link
Copy Markdown
Contributor

a-gave commented Mar 29, 2026

Tested with the below patch,

  • tried to preserve the file structure and to rename .md to .txt
  • included PKG_SOURCE_SUBMODULES:=skip to avoid puling libremesh.github.io submodules since it would clone the entire lime-packages, lime-sdk and network-profiles repositories
  • included PKG_MIRROR_HASH:=skip that turn off some warning and seems to prevent cloning the repo every time the package is 'compiled' via make -j9 package/feeds/libremesh/lime-docs/compile V=sc

Could you confirm it could be ok?

diff --git a/packages/lime-docs/Makefile b/packages/lime-docs/Makefile
index dc4f3e8b..e8c45b11 100644
--- a/packages/lime-docs/Makefile
+++ b/packages/lime-docs/Makefile
@@ -14,23 +14,15 @@ PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
 PKG_SOURCE_URL:=https://github.com/libremesh/libremesh.github.io/
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_VERSION:=HEAD
+PKG_SOURCE_SUBMODULES:=skip
+PKG_MIRROR_HASH:=skip
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
 
 include $(INCLUDE_DIR)/package.mk
 
 define Package/$(PKG_NAME)
   CATEGORY:=LibreMesh
-  TITLE:=LibreMesh English documentation
-  DEPENDS:=+$(PKG_NAME)-minimal
-  MAINTAINER:=Ilario Gelmetti <iochesonome@gmail.com>
-  URL:=https://libremesh.org/docs/
-  SUBMENU:=Offline Documentation
-  PKGARCH:=all
-endef
-
-define Package/$(PKG_NAME)-it
-  CATEGORY:=LibreMesh
-  TITLE:=LibreMesh Italian documentation
+  TITLE:=LibreMesh documentation
   DEPENDS:=+$(PKG_NAME)-minimal
   MAINTAINER:=Ilario Gelmetti <iochesonome@gmail.com>
   URL:=https://libremesh.org/docs/
@@ -48,11 +40,7 @@ define Package/$(PKG_NAME)-minimal
 endef
 
 define Package/$(PKG_NAME)/description
-Offline English documentation for LibreMesh firmware
-endef
-
-define Package/$(PKG_NAME)-it/description
-Offline Italian documentation for LibreMesh firmware
+Offline documentation for LibreMesh firmware
 endef
 
 define Package/$(PKG_NAME)-minimal/description
@@ -65,13 +53,8 @@ endef
 
 define Package/$(PKG_NAME)/install
 	$(INSTALL_DIR) $(1)/www/docs/
-	$(INSTALL_DATA) $(PKG_BUILD_DIR)/docs/en_*.txt $(1)/www/docs/
-	@ln -s /www/docs $(1)/docs
-endef
-
-define Package/$(PKG_NAME)-it/install
-	$(INSTALL_DIR) $(1)/www/docs/
-	$(INSTALL_DATA) $(PKG_BUILD_DIR)/docs/it_*.txt $(1)/www/docs/
+	$(CP) -r $(PKG_BUILD_DIR)/docs/{guide,reference} $(1)/www/docs/
+	$(FIND) $(1)/www/docs -name "*.md" | while read file_name; do mv $$$$file_name $$$${file_name/.md}.txt; done 
 	@ln -s /www/docs $(1)/docs
 endef
 
@@ -82,6 +65,4 @@ define Package/$(PKG_NAME)-minimal/install
 endef
 
 $(eval $(call BuildPackage,lime-docs))
-$(eval $(call BuildPackage,lime-docs-it))
 $(eval $(call BuildPackage,lime-docs-minimal))
-

@a-gave
Copy link
Copy Markdown
Contributor

a-gave commented Mar 30, 2026

ufff... reworded to be sure to copy 'only' markdown files and not the whole guide and reference

define Package/$(PKG_NAME)/install
	$(INSTALL_DIR) $(1)/www/docs/
	$(FIND) $(PKG_BUILD_DIR)/docs/{guide,reference} -name "*.md" | while read file_name; do \
		to_name="$$$${file_name/.md}.txt"; \
		to_name="$$$${to_name/*\/docs\/}"; \
		mkdir -p $(1)/www/docs/$$$$(dirname $$$$to_name); \
		cp $$$$file_name $(1)/www/docs/$$$$to_name ; done
	@ln -s /www/docs $(1)/docs
endef

Copy link
Copy Markdown
Contributor

@a-gave a-gave left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving! lime-docs and lime-docs-minimal at the moment fail to be compiled. Please merge this when you think it's ready!

@ilario
Copy link
Copy Markdown
Member Author

ilario commented Apr 4, 2026

Approving! lime-docs and lime-docs-minimal at the moment fail to be compiled. Please merge this when you think it's ready!

I did not manage to test this yet. Did you check if my code is working?

Yours looks much better, like it is preserving the directory structure allowing files with the same name in different directories (while my code would not). So, if your proposed code works, please open a pull request with your code and let's merge that rather than this.

@ilario
Copy link
Copy Markdown
Member Author

ilario commented Apr 7, 2026

Closing in favour of #1250

@ilario ilario closed this Apr 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants