Skip to content

Commit 2c86895

Browse files
committed
fix up markdown display in doxygen
1 parent 8d70a9b commit 2c86895

5 files changed

Lines changed: 74 additions & 72 deletions

File tree

Makefile.doc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
SRCS=$(shell find src -name '*.c')
22
HEADERS=$(shell find include -name '*.h')
3+
MDDOCS=$(shell find doc -name '*.md')
34

4-
doxygen : Doxyfile $(SRCS) $(HEADERS)
5+
doxygen : Doxyfile $(SRCS) $(HEADERS) $(MDDOCS)
56
doxygen Doxyfile
67

78
docs : doxygen

doc/guides/compile.md

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ binaries.
66
## Prerequisites
77

88
To compile mruby out of the source code you need the following tools:
9-
* C Compiler (e.g. ```gcc```)
10-
* Linker (e.g. ```gcc```)
11-
* Archive utility (e.g. ```ar```)
12-
* Parser generator (e.g. ```bison```)
13-
* Ruby 2.0 or later (e.g. ```ruby``` or ```jruby```)
9+
* C Compiler (e.g. `gcc`)
10+
* Linker (e.g. `gcc`)
11+
* Archive utility (e.g. `ar`)
12+
* Parser generator (e.g. `bison`)
13+
* Ruby 2.0 or later (e.g. `ruby` or `jruby`)
1414

1515
Optional:
1616
* GIT (to update mruby source and integrate mrbgems easier)
@@ -32,10 +32,10 @@ All tools necessary to compile mruby can be set or modified here. In case
3232
you want to maintain an additional *build_config.rb* you can define a
3333
customized path using the *$MRUBY_CONFIG* environment variable.
3434

35-
To compile just call ```./minirake``` inside of the mruby source root. To
36-
generate and execute the test tools call ```./minirake test```. To clean
37-
all build files call ```./minirake clean```. To see full command line on
38-
build, call ```./minirake -v```.
35+
To compile just call `./minirake` inside of the mruby source root. To
36+
generate and execute the test tools call `./minirake test`. To clean
37+
all build files call `./minirake clean`. To see full command line on
38+
build, call `./minirake -v`.
3939

4040
## Build Configuration
4141

@@ -79,7 +79,7 @@ toolchain :android
7979
```
8080

8181
Requires the custom standalone Android NDK and the toolchain path
82-
in ```ANDROID_STANDALONE_TOOLCHAIN```.
82+
in `ANDROID_STANDALONE_TOOLCHAIN`.
8383

8484
### Binaries
8585

@@ -97,7 +97,7 @@ conf.gem "#{root}/mrbgems/mruby-bin-mirb"
9797
### File Separator
9898

9999
Some environments require a different file separator character. It is possible to
100-
set the character via ```conf.file_separator```.
100+
set the character via `conf.file_separator`.
101101
```ruby
102102
conf.file_separator = '/'
103103
```
@@ -119,15 +119,15 @@ end
119119

120120
C Compiler has header searcher to detect installed library.
121121

122-
If you need a include path of header file use ```search_header_path```:
122+
If you need a include path of header file use `search_header_path`:
123123
```ruby
124124
# Searches ```iconv.h```.
125125
# If found it will return include path of the header file.
126126
# Otherwise it will return nil .
127127
fail 'iconv.h not found' unless conf.cc.search_header_path 'iconv.h'
128128
```
129129

130-
If you need a full file name of header file use ```search_header```:
130+
If you need a full file name of header file use `search_header`:
131131
```ruby
132132
# Searches ```iconv.h```.
133133
# If found it will return full path of the header file.
@@ -136,11 +136,11 @@ iconv_h = conf.cc.search_header 'iconv.h'
136136
print "iconv.h found: #{iconv_h}\n"
137137
```
138138

139-
Header searcher uses compiler's ```include_paths``` by default.
139+
Header searcher uses compiler's `include_paths` by default.
140140
When you are using GCC toolchain (including clang toolchain since its base is gcc toolchain)
141-
it will use compiler specific include paths too. (For example ```/usr/local/include```, ```/usr/include```)
141+
it will use compiler specific include paths too. (For example `/usr/local/include`, `/usr/include`)
142142

143-
If you need a special header search paths define a singleton method ```header_search_paths``` to C compiler:
143+
If you need a special header search paths define a singleton method `header_search_paths` to C compiler:
144144
```ruby
145145
def conf.cc.header_search_paths
146146
['/opt/local/include'] + include_paths
@@ -222,17 +222,17 @@ See doc/mrbgems/README.md for more option about mrbgems.
222222

223223
Configuration Mrbtest build process.
224224

225-
If you want mrbtest.a only, You should set ```conf.build_mrbtest_lib_only```
225+
If you want mrbtest.a only, You should set `conf.build_mrbtest_lib_only`
226226
```ruby
227227
conf.build_mrbtest_lib_only
228228
```
229229

230230
### Bintest
231231

232232
Tests for mrbgem tools using CRuby.
233-
To have bintests place \*.rb scripts to ```bintest/``` directory of mrbgems.
234-
See ```mruby-bin-*/bintest/*.rb``` if you need examples.
235-
If you want a temporary files use `tempfile` module of CRuby instead of ```/tmp/```.
233+
To have bintests place \*.rb scripts to `bintest/` directory of mrbgems.
234+
See `mruby-bin-*/bintest/*.rb` if you need examples.
235+
If you want a temporary files use `tempfile` module of CRuby instead of `/tmp/`.
236236

237237
You can enable it with following:
238238
```ruby
@@ -247,8 +247,8 @@ correctly. To support mrbgems written in C++, mruby can be
247247
configured to use C++ exception.
248248

249249
There are two levels of C++ exception handling. The one is
250-
```enable_cxx_exception``` that enables C++ exception, but
251-
uses C ABI. The other is ```enable_cxx_abi``` where all
250+
`enable_cxx_exception` that enables C++ exception, but
251+
uses C ABI. The other is `enable_cxx_abi` where all
252252
files are compiled by C++ compiler.
253253

254254
When you mix C++ code, C++ exception would be enabled automatically.
@@ -266,7 +266,7 @@ C++ exception, add following:
266266
conf.disable_cxx_exception
267267
```
268268
and you will get an error when you try to use C++ gem.
269-
Note that it must be called before ```enable_cxx_exception``` or ```gem``` method.
269+
Note that it must be called before `enable_cxx_exception` or `gem` method.
270270

271271
### Debugging mode
272272

@@ -276,17 +276,17 @@ conf.enable_debug
276276
```
277277

278278
When debugging mode is enabled
279-
* Macro ```MRB_DEBUG``` would be defined.
280-
* Which means ```mrb_assert()``` macro is enabled.
281-
* Debug information of irep would be generated by ```mrbc```.
282-
* Because ```-g``` flag would be added to ```mrbc``` runner.
279+
* Macro `MRB_DEBUG` would be defined.
280+
* Which means `mrb_assert()` macro is enabled.
281+
* Debug information of irep would be generated by `mrbc`.
282+
* Because `-g` flag would be added to `mrbc` runner.
283283
* You can have better backtrace of mruby scripts with this.
284284

285285
## Cross-Compilation
286286

287287
mruby can also be cross-compiled from one platform to another. To
288288
achieve this the *build_config.rb* needs to contain an instance of
289-
```MRuby::CrossBuild```. This instance defines the compilation
289+
`MRuby::CrossBuild`. This instance defines the compilation
290290
tools and flags for the target platform. An example could look
291291
like this:
292292
```ruby
@@ -298,12 +298,12 @@ MRuby::CrossBuild.new('32bit') do |conf|
298298
end
299299
```
300300

301-
All configuration options of ```MRuby::Build``` can also be used
302-
in ```MRuby::CrossBuild```.
301+
All configuration options of `MRuby::Build` can also be used
302+
in `MRuby::CrossBuild`.
303303

304304
### Mrbtest in Cross-Compilation
305305

306-
In cross compilation, you can run ```mrbtest``` on emulator if
306+
In cross compilation, you can run `mrbtest` on emulator if
307307
you have it by changing configuration of test runner.
308308
```ruby
309309
conf.test_runner do |t|
@@ -350,15 +350,15 @@ in *build/host/src*)
350350
result will be stored in *build/host/src/y.tab.c*)
351351
* compile *build/host/src/y.tab.c* to *build/host/src/y.tab.o*
352352
* create *build/host/lib/libmruby_core.a* out of all object files (C only)
353-
* create ```build/host/bin/mrbc``` by compiling *tools/mrbc/mrbc.c* and
353+
* create `build/host/bin/mrbc` by compiling *tools/mrbc/mrbc.c* and
354354
linking with *build/host/lib/libmruby_core.a*
355355
* create *build/host/mrblib/mrblib.c* by compiling all \*.rb files
356-
under *mrblib* with ```build/host/bin/mrbc```
356+
under *mrblib* with `build/host/bin/mrbc`
357357
* compile *build/host/mrblib/mrblib.c* to *build/host/mrblib/mrblib.o*
358358
* create *build/host/lib/libmruby.a* out of all object files (C and Ruby)
359-
* create ```build/host/bin/mruby``` by compiling *mrbgems/mruby-bin-mruby/tools/mruby/mruby.c* and
359+
* create `build/host/bin/mruby` by compiling *mrbgems/mruby-bin-mruby/tools/mruby/mruby.c* and
360360
linking with *build/host/lib/libmruby.a*
361-
* create ```build/host/bin/mirb``` by compiling *mrbgems/mruby-bin-mirb/tools/mirb/mirb.c* and
361+
* create `build/host/bin/mirb` by compiling *mrbgems/mruby-bin-mirb/tools/mirb/mirb.c* and
362362
linking with *build/host/lib/libmruby.a*
363363
364364
```
@@ -427,15 +427,15 @@ in *build/i386/src*)
427427
result will be stored in *build/i386/src/y.tab.c*)
428428
* cross-compile *build/i386/src/y.tab.c* to *build/i386/src/y.tab.o*
429429
* create *build/i386/mrblib/mrblib.c* by compiling all \*.rb files
430-
under *mrblib* with the native ```build/host/bin/mrbc```
430+
under *mrblib* with the native `build/host/bin/mrbc`
431431
* cross-compile *build/host/mrblib/mrblib.c* to *build/host/mrblib/mrblib.o*
432432
* create *build/i386/lib/libmruby.a* out of all object files (C and Ruby)
433-
* create ```build/i386/bin/mruby``` by cross-compiling *mrbgems/mruby-bin-mruby/tools/mruby/mruby.c* and
433+
* create `build/i386/bin/mruby` by cross-compiling *mrbgems/mruby-bin-mruby/tools/mruby/mruby.c* and
434434
linking with *build/i386/lib/libmruby.a*
435-
* create ```build/i386/bin/mirb``` by cross-compiling *mrbgems/mruby-bin-mirb/tools/mirb/mirb.c* and
435+
* create `build/i386/bin/mirb` by cross-compiling *mrbgems/mruby-bin-mirb/tools/mirb/mirb.c* and
436436
linking with *build/i386/lib/libmruby.a*
437437
* create *build/i386/lib/libmruby_core.a* out of all object files (C only)
438-
* create ```build/i386/bin/mrbc``` by cross-compiling *tools/mrbc/mrbc.c* and
438+
* create `build/i386/bin/mrbc` by cross-compiling *tools/mrbc/mrbc.c* and
439439
linking with *build/i386/lib/libmruby_core.a*
440440
441441
```
@@ -482,7 +482,7 @@ all usages of stdio and doesn't compile any binaries (e.g. mrbc).
482482
## Test Environment
483483
484484
mruby's build process includes a test environment. In case you start the testing
485-
of mruby, a native binary called ```mrbtest``` will be generated and executed.
485+
of mruby, a native binary called `mrbtest` will be generated and executed.
486486
This binary contains all test cases which are defined under *test/t*. In case
487487
of a cross-compilation an additional cross-compiled *mrbtest* binary is
488488
generated. You can copy this binary and run on your target system.

doc/limitations.md

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,17 @@ This document does not contain a complete list of limitations.
1414
Please help to improve it by submitting your findings.
1515

1616

17-
## ```1/2``` gives ```0.5```
17+
## `1/2` gives `0.5`
1818

19-
Since mruby does not have ```Bignum```, bigger integers are represented
20-
by ```Float``` numbers. To enhance interoperability between ```Fixnum```
21-
and ```Float```, mruby provides ```Float#upto``` and other iterating
22-
methods for the ```Float``` class. As a side effect, ```1/2``` gives ```0.5```
23-
not ```0```.
19+
Since mruby does not have `Bignum`, bigger integers are represented
20+
by `Float` numbers. To enhance interoperability between `Fixnum`
21+
and `Float`, mruby provides `Float#upto` and other iterating
22+
methods for the `Float` class. As a side effect, `1/2` gives `0.5`
23+
not `0`.
2424

25-
## ```Array``` passed to ```puts```
25+
## `Array` passed to `puts`
2626

27-
Passing an Array to ```puts``` results in different output.
27+
Passing an Array to `puts` results in different output.
2828

2929
```ruby
3030
puts [1,2,3]
@@ -44,9 +44,9 @@ puts [1,2,3]
4444
[1, 2, 3]
4545
```
4646

47-
## ```Kernel.raise``` in rescue clause
47+
## `Kernel.raise` in rescue clause
4848

49-
```Kernel.raise``` without arguments does not raise the current exception within
49+
`Kernel.raise` without arguments does not raise the current exception within
5050
a rescue clause.
5151

5252
```ruby
@@ -59,21 +59,21 @@ end
5959

6060
#### Ruby [ruby 2.0.0p645 (2015-04-13 revision 50299)]
6161

62-
```ZeroDivisionError``` is raised.
62+
`ZeroDivisionError` is raised.
6363

6464
#### mruby [2.0.1 (2019-4-4)]
6565

6666
No exception is raised.
6767

6868
## Fiber execution can't cross C function boundary
6969

70-
mruby's ```Fiber``` is implemented in a similar way to Lua's co-routine. This
70+
mruby's `Fiber` is implemented in a similar way to Lua's co-routine. This
7171
results in the consequence that you can't switch context within C functions.
72-
Only exception is ```mrb_fiber_yield``` at return.
72+
Only exception is `mrb_fiber_yield` at return.
7373

74-
## ```Array``` does not support instance variables
74+
## `Array` does not support instance variables
7575

76-
To reduce memory consumption ```Array``` does not support instance variables.
76+
To reduce memory consumption `Array` does not support instance variables.
7777

7878
```ruby
7979
class Liste < Array
@@ -87,11 +87,11 @@ p Liste.new "foobar"
8787

8888
#### Ruby [ruby 2.0.0p645 (2015-04-13 revision 50299)]
8989

90-
``` [] ```
90+
` [] `
9191

9292
#### mruby [2.0.1 (2019-4-4)]
9393

94-
```ArgumentError``` is raised.
94+
`ArgumentError` is raised.
9595

9696
## Method visibility
9797

@@ -128,8 +128,8 @@ true
128128

129129
## defined?
130130

131-
The ```defined?``` keyword is considered too complex to be fully
132-
implemented. It is recommended to use ```const_defined?``` and
131+
The `defined?` keyword is considered too complex to be fully
132+
implemented. It is recommended to use `const_defined?` and
133133
other reflection methods instead.
134134

135135
```ruby
@@ -144,9 +144,9 @@ nil
144144

145145
#### mruby [2.0.1 (2019-4-4)]
146146

147-
```NameError``` is raised.
147+
`NameError` is raised.
148148

149-
## ```alias``` on global variables
149+
## `alias` on global variables
150150

151151
Aliasing a global variable works in CRuby but is not part
152152
of the ISO standard.
@@ -157,7 +157,7 @@ alias $a $__a__
157157

158158
#### Ruby [ruby 2.0.0p645 (2015-04-13 revision 50299)]
159159

160-
``` nil ```
160+
` nil `
161161

162162
#### mruby [2.0.1 (2019-4-4)]
163163

@@ -178,12 +178,12 @@ end
178178

179179
#### Ruby [ruby 2.0.0p645 (2015-04-13 revision 50299)]
180180

181-
```ArgumentError``` is raised.
182-
The re-defined ```+``` operator does not accept any arguments.
181+
`ArgumentError` is raised.
182+
The re-defined `+` operator does not accept any arguments.
183183

184184
#### mruby [2.0.1 (2019-4-4)]
185185

186-
``` 'ab' ```
186+
` 'ab' `
187187
Behavior of the operator wasn't changed.
188188

189189
## Kernel#binding is not supported

doc/opcode.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ with `"`, either `OP_EXT1` or `OP_EXT2` or `OP_EXT2` can be prefixed.
3131

3232
## table.1 Instruction Table
3333

34+
```
3435
|Instruction Name |Operand type |Semantics
3536
|-----------------|-------------|-----------------
3637
|OP_NOP | - |
@@ -125,3 +126,4 @@ with `"`, either `OP_EXT1` or `OP_EXT2` or `OP_EXT2` can be prefixed.
125126
|OP_EXT2 |- |make 2nd operand 16bit
126127
|OP_EXT3 |- |make 1st and 2nd operands 16bit
127128
|OP_STOP |- |stop VM
129+
```

include/mruby/object.h

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,14 @@
88
#define MRUBY_OBJECT_H
99

1010
#define MRB_OBJECT_HEADER \
11-
enum mrb_vtype tt:8; \
12-
uint32_t color:3; \
13-
uint32_t flags:21; \
14-
struct RClass *c; \
15-
struct RBasic *gcnext \
11+
enum mrb_vtype tt:8; \
12+
uint32_t color:3; \
13+
uint32_t flags:21; \
14+
struct RClass *c; \
15+
struct RBasic *gcnext
1616

1717
#define MRB_FLAG_TEST(obj, flag) ((obj)->flags & (flag))
1818

19-
2019
struct RBasic {
2120
MRB_OBJECT_HEADER;
2221
};

0 commit comments

Comments
 (0)