Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Source code links with add_language_extension() are incorrect #301

Open
eruber opened this issue Jul 6, 2018 · 2 comments
Open

Source code links with add_language_extension() are incorrect #301

eruber opened this issue Jul 6, 2018 · 2 comments

Comments

@eruber
Copy link

eruber commented Jul 6, 2018

With the following in config.ld:
add_language_extension('ttslua','lua')
prettify_files=true

The output source is correctly generated as in:
output/source/vector.ttslua.html

However, the source code links generated in the output/modules/vector.html module file is to:
output/source/vector.lua.html
which is incorrect.

Perhaps I am missing a config setting?

@eruber
Copy link
Author

eruber commented Jul 6, 2018

I managed to fix this in ldoc/html.lua in the function ldoc.source_ref() which I changed to this:
function ldoc.source_ref (fun)
local path
local ext
path, ext = tools.split_dotted_name(fun.module.file.filename)
local modname = fun.module.name
local pack,name = tools.split_dotted_name(modname)
if not pack then
name = modname
end
-- return (ldoc.single and "" or "../").."source/"..name..'.lua.html#'..fun.lineno
return (ldoc.single and "" or "../").."source/"..name..'.'..ext..'.html#'..fun.lineno
end

@eruber
Copy link
Author

eruber commented Jul 7, 2018

I sent a pull request for my fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant