Comments (10)
It should happen automatically, when docs in Markdown format are converted (using ldoc.prettify). Is this perhaps a style sheet problem? You can adjust the colours if they're not showing up well.
from ldoc.
Does not happen for @Usage blocks. I tried to indent @Usage code, but it doesn't help.
from ldoc.
Ah, I see - yes, that sounds like a good idea. In most cases usage code is Lua, so there is no harm in prettifying all usage blocks.
from ldoc.
I'll send you a pull request soon with (optional) lxsh highlighting.
from ldoc.
That would be cool. I'm thinking of how best to indicate what language is to be used for a particular block. Currently in Markdown docs there's only a @plain directiive for switching off highlighting; it would be relatively easy to add support for other languages (particularly C/C++) in code blocks. Let me first add Lua support and I'll push that.
from ldoc.
About that, why not adding support for backticks, as with Github Flavoured Markdown (See Fenced code blocks) ? For instance, I am using them when writing snippets of code in most of my READMEs, so I won't have to change anything in the Markdown code and still use the same README to generate HTML with LDoc. Just asking, though.
from ldoc.
I like this suggestion, I find them easier to type myself and they are becoming a standard. Then it's very clear what the language is. However, how would that work with @Usage?
from ldoc.
I could not find any good gfm library for lua. Also, markdown & discount can mess around, I have very positive experience with gfm-like libs on node, smart libs like marked, but they are not available for lua :/
@Usage should take language argument somehow.
from ldoc.
Well, if you find such a thing (or do the translation from Ruby yourself?) then LDoc is happy to accommodate new format parsers. One of my collaborators likes Lunamark and has added support for it.
from ldoc.
Closing issue due to recent implementation of this task and lxsh introduction as well. Thanks @stevedonovan for your code merge mastery. There are some minor glitches in README.md converter, e.g. last new line in ``` blocks doesn't get trimmed and indentation is messed up if // comments used in c-code, I am not exactly sure whether it's lxsh problem or not. But this is the least that bothers me now and it works fine for @Usage blocks.
from ldoc.
Related Issues (20)
- luarocks install ldoc throw 404 HOT 1
- Representing module with constants HOT 2
- LDoc fails to reference to a table value HOT 1
- Using custom CSS (-s option) fails with error: ldoc/tools.lua:233: attempt to compare number with nil HOT 2
- Part after dot is ignored HOT 2
- How to add description of example script HOT 1
- @type changes behavior when used in @submodule HOT 5
- LuaRocks module: broken link to project homepage HOT 2
- How to use @script tag? HOT 2
- Filename case issues for cross-platform document generation HOT 5
- --fatalwarnings returns 0 exit code with invalid Markdown references
- Error message on invalid tag somewhat obtuse and doesn't point out the issue being the undefined tag HOT 10
- LDoc breaks when loading config file. HOT 2
- [Meta] Is this repo dead? HOT 2
- How do I ignore certain files/directories? HOT 2
- `hxx` extension support HOT 2
- multiple raise statements cause error HOT 6
- Support nested subparams HOT 2
- Question: is there a way to generate document from lua-language-server type annotations?
- Add LuaCATS as alternative tag handling scheme HOT 4
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 ldoc.