Unverified Commit 2d09fd21 authored by Yukihiro "Matz" Matsumoto's avatar Yukihiro "Matz" Matsumoto Committed by GitHub

Merge pull request #4669 from davidsiaw/doxygen

Fixes for Doxygen docs
parents a4870a57 63756399
......@@ -31,6 +31,6 @@ tags
/benchmark/*.png
/doc/api
/doxygen/
/doc/capi
/src/y.tab.c
......@@ -12,7 +12,7 @@ PROJECT_BRIEF = "mruby is the lightweight implementation of the Ruby la
PROJECT_LOGO = doc/mruby_logo_red_icon.png
OUTPUT_DIRECTORY = doxygen
OUTPUT_DIRECTORY = doc/capi
USE_MDFILE_AS_MAINPAGE = README.md
......@@ -49,6 +49,12 @@ EXTRACT_ALL = NO
# Document MRB_INLINE functions
EXTRACT_STATIC = YES
JAVADOC_AUTOBRIEF = YES
QT_AUTOBRIEF = NO
QUIET = YES
WARN_IF_UNDOCUMENTED = NO
#===========================================================================
# BELOW THIS LINE IS CRUFT GENERATED BY doxygen -g
# If you edit anything below this, bring it up here so its easier to read.
......@@ -174,22 +180,6 @@ STRIP_FROM_INC_PATH =
SHORT_NAMES = NO
# If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the
# first line (until the first dot) of a Javadoc-style comment as the brief
# description. If set to NO, the Javadoc-style will behave just like regular Qt-
# style comments (thus requiring an explicit @brief command for a brief
# description.)
# The default value is: NO.
JAVADOC_AUTOBRIEF = NO
# If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first
# line (until the first dot) of a Qt-style comment as the brief description. If
# set to NO, the Qt-style will behave just like regular Qt-style comments (thus
# requiring an explicit \brief command for a brief description.)
# The default value is: NO.
QT_AUTOBRIEF = NO
# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a
# multi-line C++ special comment block (i.e. a block of //! or /// comments) as
......@@ -711,12 +701,6 @@ CITE_BIB_FILES =
# Configuration options related to warning and progress messages
#---------------------------------------------------------------------------
# The QUIET tag can be used to turn on/off the messages that are generated to
# standard output by doxygen. If QUIET is set to YES this implies that the
# messages are off.
# The default value is: NO.
QUIET = NO
# The WARNINGS tag can be used to turn on/off the warning messages that are
# generated to standard error (stderr) by doxygen. If WARNINGS is set to YES
......@@ -727,12 +711,6 @@ QUIET = NO
WARNINGS = YES
# If the WARN_IF_UNDOCUMENTED tag is set to YES then doxygen will generate
# warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag
# will automatically be disabled.
# The default value is: YES.
WARN_IF_UNDOCUMENTED = YES
# If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for
# potential errors in the documentation, such as not documenting some parameters
......
......@@ -2,8 +2,6 @@
# We provide a minimalistic version called minirake inside of our
# codebase.
-include Makefile.doc
RAKE = ruby ./minirake
all :
......@@ -14,6 +12,6 @@ test : all
$(RAKE) test
.PHONY : test
clean : docsclean
clean :
$(RAKE) clean
.PHONY : clean
SRCS=$(shell find src -name '*.c')
HEADERS=$(shell find include -name '*.h')
MDDOCS=$(shell find doc -name '*.md')
doxygen : Doxyfile $(SRCS) $(HEADERS) $(MDDOCS)
doxygen Doxyfile
docs : doxygen
docserver : docs
firefox doxygen/html/index.html
docsclean :
rm -rf doxygen
.PHONY : docserver docsclean
......@@ -50,6 +50,19 @@ Or
$ ruby ./minirake test
## Building documentation
There are two sets of documentation in mruby: the mruby API (generated by yard) and C API (Doxygen)
To build both of them, simply go
rake doc
You can also view them in your browser
rake view_api
rake view_capi
## How to customize mruby (mrbgems)
mruby contains a package manager called *mrbgems*. To create extensions
......
......@@ -30,6 +30,7 @@ load "#{MRUBY_ROOT}/tasks/libmruby.rake"
load "#{MRUBY_ROOT}/tasks/benchmark.rake"
load "#{MRUBY_ROOT}/tasks/gitlab.rake"
load "#{MRUBY_ROOT}/tasks/doc.rake"
def install_D(src, dst)
opts = { :verbose => $verbose }
......@@ -150,19 +151,9 @@ task :clean do
end
desc "clean everything!"
task :deep_clean => ["clean"] do
task :deep_clean => ["clean", "clean_doc"] do
MRuby.each_target do |t|
FileUtils.rm_rf t.gem_clone_dir, { :verbose => $verbose }
end
puts "Cleaned up mrbgems build folder"
end
desc 'generate document'
task :doc do
begin
sh "mrbdoc"
rescue
puts "ERROR: To generate documents, you should install yard-mruby gem."
puts " $ gem install yard-mruby"
end
end
doc/mruby_logo_red_icon.png

3.67 KB | W: | H:

doc/mruby_logo_red_icon.png

8.36 KB | W: | H:

doc/mruby_logo_red_icon.png
doc/mruby_logo_red_icon.png
doc/mruby_logo_red_icon.png
doc/mruby_logo_red_icon.png
  • 2-up
  • Swipe
  • Onion skin
This diff is collapsed.
......@@ -69,14 +69,14 @@ mrb_break_value_set(struct RBreak *brk, mrb_value val)
/**
* Protect
*
* @mrbgem mruby-error
* Implemented in the mruby-error mrbgem
*/
MRB_API mrb_value mrb_protect(mrb_state *mrb, mrb_func_t body, mrb_value data, mrb_bool *state);
/**
* Ensure
*
* @mrbgem mruby-error
* Implemented in the mruby-error mrbgem
*/
MRB_API mrb_value mrb_ensure(mrb_state *mrb, mrb_func_t body, mrb_value b_data,
mrb_func_t ensure, mrb_value e_data);
......@@ -84,7 +84,7 @@ MRB_API mrb_value mrb_ensure(mrb_state *mrb, mrb_func_t body, mrb_value b_data,
/**
* Rescue
*
* @mrbgem mruby-error
* Implemented in the mruby-error mrbgem
*/
MRB_API mrb_value mrb_rescue(mrb_state *mrb, mrb_func_t body, mrb_value b_data,
mrb_func_t rescue, mrb_value r_data);
......@@ -92,7 +92,7 @@ MRB_API mrb_value mrb_rescue(mrb_state *mrb, mrb_func_t body, mrb_value b_data,
/**
* Rescue exception
*
* @mrbgem mruby-error
* Implemented in the mruby-error mrbgem
*/
MRB_API mrb_value mrb_rescue_exceptions(mrb_state *mrb, mrb_func_t body, mrb_value b_data,
mrb_func_t rescue, mrb_value r_data,
......
......@@ -138,7 +138,6 @@ MRB_API mrb_int mrb_str_index(mrb_state*, mrb_value, const char*, mrb_int, mrb_i
*
* Example:
*
* !!!c
* int
* main(int argc,
* char **argv)
......@@ -167,17 +166,16 @@ MRB_API mrb_int mrb_str_index(mrb_state*, mrb_value, const char*, mrb_int, mrb_i
* return 0;
* }
*
*
* Result:
*
* => "abcdef"
*
* @param [mrb_state] mrb The current mruby state.
* @param [mrb_value] self String to concatenate.
* @param [mrb_value] other String to append to self.
* @param mrb The current mruby state.
* @param self String to concatenate.
* @param other String to append to self.
* @return [mrb_value] Returns a new String appending other to self.
*/
MRB_API void mrb_str_concat(mrb_state*, mrb_value, mrb_value);
MRB_API void mrb_str_concat(mrb_state *mrb, mrb_value self, mrb_value other);
/**
* Adds two strings together.
......@@ -185,7 +183,6 @@ MRB_API void mrb_str_concat(mrb_state*, mrb_value, mrb_value);
*
* Example:
*
* !!!c
* int
* main(int argc,
* char **argv)
......@@ -226,27 +223,27 @@ MRB_API void mrb_str_concat(mrb_state*, mrb_value, mrb_value);
* => "def" # Second string
* => "abcdef" # First & Second concatenated.
*
* @param [mrb_state] mrb The current mruby state.
* @param [mrb_value] a First string to concatenate.
* @param [mrb_value] b Second string to concatenate.
* @param mrb The current mruby state.
* @param a First string to concatenate.
* @param b Second string to concatenate.
* @return [mrb_value] Returns a new String containing a concatenated to b.
*/
MRB_API mrb_value mrb_str_plus(mrb_state*, mrb_value, mrb_value);
MRB_API mrb_value mrb_str_plus(mrb_state *mrb, mrb_value a, mrb_value b);
/**
* Converts pointer into a Ruby string.
*
* @param [mrb_state] mrb The current mruby state.
* @param [void*] p The pointer to convert to Ruby string.
* @param mrb The current mruby state.
* @param p The pointer to convert to Ruby string.
* @return [mrb_value] Returns a new Ruby String.
*/
MRB_API mrb_value mrb_ptr_to_str(mrb_state *, void*);
MRB_API mrb_value mrb_ptr_to_str(mrb_state *mrb, void *p);
/**
* Returns an object as a Ruby string.
*
* @param [mrb_state] mrb The current mruby state.
* @param [mrb_value] obj An object to return as a Ruby string.
* @param mrb The current mruby state.
* @param obj An object to return as a Ruby string.
* @return [mrb_value] An object as a Ruby string.
*/
MRB_API mrb_value mrb_obj_as_string(mrb_state *mrb, mrb_value obj);
......@@ -257,7 +254,6 @@ MRB_API mrb_value mrb_obj_as_string(mrb_state *mrb, mrb_value obj);
*
* Example:
*
* !!!c
* int
* main(int argc,
* char **argv)
......@@ -284,9 +280,9 @@ MRB_API mrb_value mrb_obj_as_string(mrb_state *mrb, mrb_value obj);
*
* => "Hello"
*
* @param [mrb_state] mrb The current mruby state.
* @param [mrb_value] str The Ruby string to resize.
* @param [mrb_value] len The length.
* @param mrb The current mruby state.
* @param str The Ruby string to resize.
* @param len The length.
* @return [mrb_value] An object as a Ruby string.
*/
MRB_API mrb_value mrb_str_resize(mrb_state *mrb, mrb_value str, mrb_int len);
......@@ -296,7 +292,6 @@ MRB_API mrb_value mrb_str_resize(mrb_state *mrb, mrb_value str, mrb_int len);
*
* Example:
*
* !!!c
* int
* main(int argc,
* char const **argv)
......@@ -326,10 +321,10 @@ MRB_API mrb_value mrb_str_resize(mrb_state *mrb, mrb_value str, mrb_int len);
*
* => "He"
*
* @param [mrb_state] mrb The current mruby state.
* @param [mrb_value] str Ruby string.
* @param [mrb_int] beg The beginning point of the sub-string.
* @param [mrb_int] len The end point of the sub-string.
* @param mrb The current mruby state.
* @param str Ruby string.
* @param beg The beginning point of the sub-string.
* @param len The end point of the sub-string.
* @return [mrb_value] An object as a Ruby sub-string.
*/
MRB_API mrb_value mrb_str_substr(mrb_state *mrb, mrb_value str, mrb_int beg, mrb_int len);
......@@ -338,8 +333,8 @@ MRB_API mrb_value mrb_str_substr(mrb_state *mrb, mrb_value str, mrb_int beg, mrb
* Returns a Ruby string type.
*
*
* @param [mrb_state] mrb The current mruby state.
* @param [mrb_value] str Ruby string.
* @param mrb The current mruby state.
* @param str Ruby string.
* @return [mrb_value] A Ruby string.
*/
MRB_API mrb_value mrb_ensure_string_type(mrb_state *mrb, mrb_value str);
......@@ -364,8 +359,8 @@ MRB_API mrb_int mrb_string_value_len(mrb_state *mrb, mrb_value str);
* Duplicates a string object.
*
*
* @param [mrb_state] mrb The current mruby state.
* @param [mrb_value] str Ruby string.
* @param mrb The current mruby state.
* @param str Ruby string.
* @return [mrb_value] Duplicated Ruby string.
*/
MRB_API mrb_value mrb_str_dup(mrb_state *mrb, mrb_value str);
......@@ -373,8 +368,8 @@ MRB_API mrb_value mrb_str_dup(mrb_state *mrb, mrb_value str);
/**
* Returns a symbol from a passed in Ruby string.
*
* @param [mrb_state] mrb The current mruby state.
* @param [mrb_value] self Ruby string.
* @param mrb The current mruby state.
* @param self Ruby string.
* @return [mrb_value] A symbol.
*/
MRB_API mrb_value mrb_str_intern(mrb_state *mrb, mrb_value self);
......@@ -393,9 +388,9 @@ MRB_API mrb_value mrb_str_to_str(mrb_state *mrb, mrb_value str);
/**
* Returns true if the strings match and false if the strings don't match.
*
* @param [mrb_state] mrb The current mruby state.
* @param [mrb_value] str1 Ruby string to compare.
* @param [mrb_value] str2 Ruby string to compare.
* @param mrb The current mruby state.
* @param str1 Ruby string to compare.
* @param str2 Ruby string to compare.
* @return [mrb_value] boolean value.
*/
MRB_API mrb_bool mrb_str_equal(mrb_state *mrb, mrb_value str1, mrb_value str2);
......@@ -403,10 +398,10 @@ MRB_API mrb_bool mrb_str_equal(mrb_state *mrb, mrb_value str1, mrb_value str2);
/**
* Returns a concatenated string comprised of a Ruby string and a C string.
*
* @param [mrb_state] mrb The current mruby state.
* @param [mrb_value] str Ruby string.
* @param [const char *] ptr A C string.
* @param [size_t] len length of C string.
* @param mrb The current mruby state.
* @param str Ruby string.
* @param ptr A C string.
* @param len length of C string.
* @return [mrb_value] A Ruby string.
* @see mrb_str_cat_cstr
*/
......@@ -415,9 +410,9 @@ MRB_API mrb_value mrb_str_cat(mrb_state *mrb, mrb_value str, const char *ptr, si
/**
* Returns a concatenated string comprised of a Ruby string and a C string.
*
* @param [mrb_state] mrb The current mruby state.
* @param [mrb_value] str Ruby string.
* @param [const char *] ptr A C string.
* @param mrb The current mruby state.
* @param str Ruby string.
* @param ptr A C string.
* @return [mrb_value] A Ruby string.
* @see mrb_str_cat
*/
......@@ -446,8 +441,8 @@ MRB_API int mrb_str_cmp(mrb_state *mrb, mrb_value str1, mrb_value str2);
* - Caller can modify returned string without affecting Ruby string
* (e.g. it can be used for mkstemp(3)).
*
* @param [mrb_state *] mrb The current mruby state.
* @param [mrb_value] str Ruby string. Must be an instance of String.
* @param mrb The current mruby state.
* @param str Ruby string. Must be an instance of String.
* @return [char *] A newly allocated C string.
*/
MRB_API char *mrb_str_to_cstr(mrb_state *mrb, mrb_value str);
......
......@@ -15,16 +15,17 @@
MRB_BEGIN_DECL
/**
* mruby Symbol.
* @class mrb_sym
* @brief mruby Symbol
*
* You can create an mrb_sym by simply using mrb_str_intern() or mrb_intern_cstr()
*/
typedef uint32_t mrb_sym;
/**
* mruby Boolean.
* @class mrb_bool
* @brief mruby Boolean
*
*
* Used internally to represent boolean. Can be TRUE or FALSE.
* Not to be confused with Ruby's boolean classes, which can be
......
......@@ -97,18 +97,15 @@ MRB_API void mrb_gv_set(mrb_state *mrb, mrb_sym sym, mrb_value val);
*
* Example:
*
* !!!ruby
* # Ruby style
* $value = nil
*
* !!!c
* // C style
* mrb_sym sym = mrb_intern_lit(mrb, "$value");
* mrb_gv_remove(mrb, sym);
*
* @param mrb The mruby state reference
* @param sym The name of the global variable
* @param val The value of the global variable
*/
MRB_API void mrb_gv_remove(mrb_state *mrb, mrb_sym sym);
......
......@@ -409,7 +409,7 @@ mrb_module_get(mrb_state *mrb, const char *name)
/*!
* Defines a class under the namespace of \a outer.
* \param outer a class which contains the new class.
* \param id name of the new class
* \param name name of the new class
* \param super a class from which the new class will derive.
* NULL means \c Object class.
* \return the created class
......@@ -1769,6 +1769,7 @@ mrb_alias_method(mrb_state *mrb, struct RClass *c, mrb_sym a, mrb_sym b)
/*!
* Defines an alias of a method.
* \param mrb the mruby state
* \param klass the class which the original method belongs to
* \param name1 a new name for the method
* \param name2 the original name of the method
......
desc 'generate document'
task :doc => [:api_doc, :capi_doc] do
end
desc 'generate yard docs'
task :api_doc do
begin
sh "mrbdoc"
rescue
puts "ERROR: To generate yard documentation, you should install yard-mruby gem."
puts " $ gem install yard-mruby yard-coderay"
end
end
desc 'generate doxygen docs'
task :capi_doc do
begin
sh "doxygen Doxyfile"
rescue
puts "ERROR: To generate C API documents, you need Doxygen."
puts " $ sudo apt-get install doxygen"
end
end
desc 'clean all built docs'
task :clean_api_doc do
FileUtils.rm_rf 'doc/api'
end
desc 'clean all built docs'
task :clean_capi_doc do
FileUtils.rm_rf 'doc/capi'
end
desc 'clean all built docs'
task :clean_doc => [:clean_api_doc, :clean_capi_doc] do
end
desc 'clean all built docs'
task :view_api => [:api_doc] do
sh 'xdg-open doc/api/index.html'
end
desc 'clean all built docs'
task :view_capi => [:capi_doc] do
sh 'xdg-open doc/capi/html/index.html'
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment