Comments (7)
I'm working on a branch that documents functions & such using LDoc. I was wondering if you could help me with descriptions for some functions. This is some of what I have:
misc_functions.lua:
- table_contains(t, e)
- Checks table for an item.
- param t: Table definition
- param e: Item to check for
- table_erase(t, e)
- Removes an item from table.
- param t: Table definition
- param e: Item to be removed
- s_protect.can_access(pos, player_name)
- Allows authorized users & mods to modify an area.
- param pos: Coordinates of node to check access rights
- param player_name: Player to check for access rights
- s_protect.get_location(pos_)
- ???
- param pos_: ???
- s_protect.get_area_bounds(pos_)
- Retrieves protected area boundaries.
- param pos_: Coordinates from which to identify protected area
- s_protect.get_center(pos1)
- Retrieves center coordinates of protected area.
- param pos1: Coordinates from which to identify protected area
- s_protect.load_config()
- Loads configurations from file.
If you have time, I would appreciate feedback & corrections.
from simple_protection.
Thanks for your effort. The documentation looks quite good already. But for my part, I would prefer a separate Markdown documentation file to not clutter the Lua files more - basically the lua_api.txt
style.
Hopefully I'll have some time tomorrow for this documentation.
from simple_protection.
Sure, that would be no problem (I think). I was attempting to do something similar with the mobs_redo mod. I created a separate file that contained all of the documentation to be parsed. I can do the same here.
from simple_protection.
Here is an example file with the documentation: api.ldoc (though, I think LDoc can parse straight markdown as well)
And here is the HTML output: API
from simple_protection.
Well so, the first version now exists here. I'm however afraid that LDoc won't be able reading this format, since it's not per-file and the parameters/return values are formatted differently to what I've seen on the project page.
The HTML version looks good, but it feels too over-engineered for a small API like this project provides.
from simple_protection.
So, I don't want to push this on you. The mod_api.txt looks nice & clean. I've seen other modders using that format or similar (is it documented somewhere?). But, I just wanted to show you a simplified layout using LDoc.
Instead of documenting each Lua script, I just grouped all functions, settings, items, etc. under individual links. It can currently be viewed (2018-07-26) on my page: Simple Protection API.
I won't bug you about it anymore. 😃
from simple_protection.
I want to suggest some new functions if possible.
s_protect.on_set_square(func(pos, name))
- Registers a function performed when an area is claimed.
- Param pos: center pos or start pos of square
- Param name: player name of owner
s_protect.on_remove_square(func(pos, name))
- Registers a function performed when an area is unclaimed.
- Param pos: center pos or start pos of square
- Param name: player name of owner
from simple_protection.
Related Issues (20)
- Formspec GUI HOT 4
- Maximum number of claims HOT 7
- s_protect.claim_to_dig = true -> server crash HOT 1
- Support parallel running protection mods HOT 5
- Text-like map of surrounding areas HOT 10
- Use mod storage HOT 2
- Shared chests HOT 1
- Use sqlite storage HOT 1
- How I can protect automatically an area for the server HOT 5
- not all the commands / areas worm in the chat window HOT 1
- List of mods that have player grouping features HOT 2
- Move files to a separate folder HOT 2
- Add Mineclone 2 Compatibility HOT 1
- A bit confusing HOT 12
- Can't Check if a Node is in Area Protected by Player Name HOT 2
- /area shareall command not working as intended HOT 1
- Improve Area HUD to show unclaimed areas
- [Q]: How do we handle Spawn? HOT 1
- breaks tnt on entire world HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from simple_protection.