Add 'Available since' to module API function docs#10229
Add 'Available since' to module API function docs#10229oranagra merged 5 commits intoredis:unstablefrom
Conversation
oranagra
left a comment
There was a problem hiding this comment.
impressive.
when i try it i get:
oran@Oran-laptop:~/work/redis$ ruby src/modules/gendoc.rb > ../redis-doc/topics/modules-api-ref.md
fatal: Not a valid object name 4.0.0:src/modules/../module.c
fatal: Not a valid object name 4.0.1:src/modules/../module.c
i supposed that maybe it's because the script care where it was executed? but i tried running it from src or src/modules folders and got the same.
p.s. maybe it's time to move this file to the utils folder?
|
Apparently it does care where it's executed. I thought I had taken that into account :-/ and as you can see |
Sure, but doesn't that break some workflow? The diff is also harder to review if the file is moved and changed at the same time. |
|
IIRC git handles renames great as long as not many lines are changed in the file. |
|
maybe rename to |
|
updating redis-doc: redis/redis-doc#1781 |
The script which generates the markdown docs from module.c is updated to include the version in which each module API function was introduced.
The script uses git tags to find this information. If git is not available or if we're not in a git repo, the 'since' is silently skipped.
The line
**Available since:** (version)is added after the function prototype. Example markdown:<span id="RedisModule_Alloc"></span> ### `RedisModule_Alloc` void *RedisModule_Alloc(size_t bytes); +**Available since:** 4.0.0 + Use like `malloc()`. Memory allocated with this function is reported in Redis INFO memory, used for keys eviction according to maxmemory settings and in general is taken into account as memory allocated by Redis. You should avoid using `malloc()`.Rename to utils/generate-module-api-doc.rb