luci-mod-network: fixes to older api docs

Signed-off-by: Paul Donald <newtwen@gmail.com>
This commit is contained in:
Paul Donald 2024-02-15 03:29:25 +01:00
parent c0655df338
commit 4c57abc77c
2 changed files with 10 additions and 10 deletions

View file

@ -3,8 +3,8 @@
See [online wiki](https://github.com/openwrt/luci/wiki/LMO) for latest version.
LMO is a simple binary format to pack language strings into a more efficient form.
Although it's suitable to store any kind of key-value table, it's only used for the LuCI *.po based translation system at the moment.
The abbreviation "LMO" stands for "Lua Machine Objects" in the style of the GNU gettext *.mo format.
Although it's suitable to store any kind of key-value table, it's only used for the LuCI \*.po based translation system at the moment.
The abbreviation "LMO" stands for "Lua Machine Objects" in the style of the GNU gettext \*.mo format.
## Format Specification
@ -83,7 +83,7 @@ In order to process a LMO file, an implementation would have to do the following
## Hash Function
The current LuCI-LMO implementation uses the "Super Fast Hash" function which was kindly put in the public domain by it's original author. See http://www.azillionmonkeys.com/qed/hash.html for details. Below is the C-Implementation of this function:
The current LuCI-LMO implementation uses the "Super Fast Hash" function which was kindly put in the public domain by its original author. See http://www.azillionmonkeys.com/qed/hash.html for details. Below is the C-Implementation of this function:
```c
#if (defined(__GNUC__) && defined(__i386__))

View file

@ -1,8 +1,8 @@
# HowTo: Create Themes
**Note:** You should read the [Module Reference](./Modules.md) and the [Template Reference](./Templates.md) before.
**Note:** You have already read the [Module Reference](./Modules.md) and the [Template Reference](./Templates.md).
We assume you want to call your new theme `mytheme`.
Make sure you replace this by your module name everytime this is mentionend in this Howto.
Replace `mytheme` with your module name every time this is mentioned in this Howto.
## Creating the structure
At first create a new theme directory `themes/luci-theme-mytheme`.
@ -36,7 +36,7 @@ Create two LuCI HTML-Templates named `header.htm` and `footer.htm` under `luasrc
The `header.htm` will be included at the beginning of each rendered page and the `footer.htm` at the end.
So your `header.htm` will probably contain a DOCTYPE description, headers,
the menu and layout of the page and the `footer.htm` will close all remaining open tags and may add a footer bar.
But hey that's your choice you are the designer ;-).
But hey that's your choice: you are the designer ;-).
Just make sure your `header.htm` begins with the following lines:
```
@ -45,12 +45,12 @@ require("luci.http").prepare_content("text/html")
-%>
```
This makes sure your content will be sent to the client with the right content type.
This ensures your content is sent to the client with the right content type.
Of course you can adapt `text/html` to your needs.
Put any stylesheets, Javascripts, images, ... into `htdocs/luci-static/mytheme`.
You should refer to this directory in your header and footer templates as: `<%=media%>`.
Refer to this directory in your header and footer templates as: `<%=media%>`.
That means for a stylesheet `htdocs/luci-static/mytheme/cascade.css` you would write:
```html
<link rel="stylesheet" type="text/css" href="<%=media%>/cascade.css" />
@ -58,7 +58,7 @@ That means for a stylesheet `htdocs/luci-static/mytheme/cascade.css` you would w
## Making the theme selectable
If you are done with your work there are two last steps to do.
To make your theme OpenWrt-capable and selectable on the settings page you should now create a file `root/etc/uci-defaults/luci-theme-mytheme` with the following contents:
To make your theme OpenWrt-capable and selectable on the settings page, create a file `root/etc/uci-defaults/luci-theme-mytheme` with the following contents:
```sh
#!/bin/sh
uci batch <<-EOF
@ -76,6 +76,6 @@ and another file `ipkg/postinst` with the following content:
}
```
This is some OpenWrt magic to correctly register the template with LuCI when it gets installed.
This correctly registers the template with LuCI when it gets installed.
That's all. Now send your theme to the LuCI developers to get it into the development repository - if you like.