Skip to content

Commit

Permalink
luci-mod-network: fixes to older api docs
Browse files Browse the repository at this point in the history
Signed-off-by: Paul Donald <[email protected]>
  • Loading branch information
systemcrash committed Feb 15, 2024
1 parent c0655df commit 4c57abc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions docs/LMO.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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__))
Expand Down
14 changes: 7 additions & 7 deletions docs/ThemesHowTo.md
Original file line number Diff line number Diff line change
@@ -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`.
Expand Down Expand Up @@ -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:
```
Expand All @@ -45,20 +45,20 @@ 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" />
```

## 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
Expand All @@ -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.

0 comments on commit 4c57abc

Please sign in to comment.