Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
hasumikin committed Jan 8, 2024
1 parent 00e5b0d commit 11b6e7f
Show file tree
Hide file tree
Showing 83 changed files with 979 additions and 1,285 deletions.
10 changes: 7 additions & 3 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ require "fileutils"
task :default => :all

desc "Run all tasks"
task :all => ["rbs_doc:generate"]
task :all => ["steep_check", "rbs_doc:generate"]

desc "Setup"
task :setup => [:install_steep, :install_picoruby]
Expand Down Expand Up @@ -35,12 +35,16 @@ task :s do
sh "bundle exec jekyll serve"
end

desc "Run steep check"
task :steep_check do
FileUtils.cd PICORUBY_DIR do
sh "rake steep"
end
end

require_relative "lib/rbs_doc"

namespace :rbs_doc do
task :default => :generate

desc "Generate documentation"
task :generate do |t, args|
FileUtils.cd File.expand_path("../picoruby", __FILE__) do
Expand Down
111 changes: 53 additions & 58 deletions _data/sidebars/picoruby_sidebar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,10 @@ entries:
- title: Builtin class
output: web pdf
folderitems:
- title: ArgumentError
url: "/ArgumentError.html"
output: web pdf
type: homepage
- title: Array
url: "/Array.html"
output: web pdf
type: homepage
- title: Exception
url: "/Exception.html"
output: web pdf
type: homepage
- title: FalseClass
url: "/FalseClass.html"
output: web pdf
Expand All @@ -62,18 +54,10 @@ entries:
url: "/Math.html"
output: web pdf
type: homepage
- title: NameError
url: "/NameError.html"
output: web pdf
type: homepage
- title: NilClass
url: "/NilClass.html"
output: web pdf
type: homepage
- title: NoMethodError
url: "/NoMethodError.html"
output: web pdf
type: homepage
- title: Object
url: "/Object.html"
output: web pdf
Expand All @@ -86,6 +70,45 @@ entries:
url: "/Range.html"
output: web pdf
type: homepage
- title: String
url: "/String.html"
output: web pdf
type: homepage
- title: Symbol
url: "/Symbol.html"
output: web pdf
type: homepage
- title: TrueClass
url: "/TrueClass.html"
output: web pdf
type: homepage
- title: Error class
output: web pdf
folderitems:
- title: ArgumentError
url: "/ArgumentError.html"
output: web pdf
type: homepage
- title: Exception
url: "/Exception.html"
output: web pdf
type: homepage
- title: IOError
url: "/IOError.html"
output: web pdf
type: homepage
- title: LoadError
url: "/LoadError.html"
output: web pdf
type: homepage
- title: NameError
url: "/NameError.html"
output: web pdf
type: homepage
- title: NoMethodError
url: "/NoMethodError.html"
output: web pdf
type: homepage
- title: RangeError
url: "/RangeError.html"
output: web pdf
Expand All @@ -94,26 +117,18 @@ entries:
url: "/RuntimeError.html"
output: web pdf
type: homepage
- title: StandardError
url: "/StandardError.html"
output: web pdf
type: homepage
- title: String
url: "/String.html"
- title: SQLite3::Exception
url: "/SQLite3_Exception.html"
output: web pdf
type: homepage
- title: Symbol
url: "/Symbol.html"
- title: StandardError
url: "/StandardError.html"
output: web pdf
type: homepage
- title: SyntaxError
url: "/SyntaxError.html"
output: web pdf
type: homepage
- title: TrueClass
url: "/TrueClass.html"
output: web pdf
type: homepage
- title: TypeError
url: "/TypeError.html"
output: web pdf
Expand Down Expand Up @@ -169,6 +184,10 @@ entries:
url: "/PCF8523.html"
output: web pdf
type: homepage
- title: UART::RxBuffer
url: "/UART_RxBuffer.html"
output: web pdf
type: homepage
- title: IO Peripheral class
output: web pdf
folderitems:
Expand Down Expand Up @@ -267,6 +286,10 @@ entries:
url: "/File.html"
output: web pdf
type: homepage
- title: File::Stat
url: "/File_Stat.html"
output: web pdf
type: homepage
- title: IIRFilter
url: "/IIRFilter.html"
output: web pdf
Expand All @@ -275,18 +298,6 @@ entries:
url: "/IO.html"
output: web pdf
type: homepage
- title: IOError
url: "/IOError.html"
output: web pdf
type: homepage
- title: InstructionSequence
url: "/InstructionSequence.html"
output: web pdf
type: homepage
- title: LoadError
url: "/LoadError.html"
output: web pdf
type: homepage
- title: MML
url: "/MML.html"
output: web pdf
Expand Down Expand Up @@ -315,10 +326,6 @@ entries:
url: "/RTD_PT100.html"
output: web pdf
type: homepage
- title: RubyVM
url: "/RubyVM.html"
output: web pdf
type: homepage
- title: SQLite3
url: "/SQLite3.html"
output: web pdf
Expand All @@ -327,10 +334,6 @@ entries:
url: "/SQLite3_Database.html"
output: web pdf
type: homepage
- title: SQLite3::Exception
url: "/SQLite3_Exception.html"
output: web pdf
type: homepage
- title: SQLite3::ResultSet
url: "/SQLite3_ResultSet.html"
output: web pdf
Expand All @@ -355,10 +358,6 @@ entries:
url: "/Shell_Command.html"
output: web pdf
type: homepage
- title: Stat
url: "/Stat.html"
output: web pdf
type: homepage
- title: Task
url: "/Task.html"
output: web pdf
Expand Down Expand Up @@ -387,12 +386,8 @@ entries:
url: "/Time.html"
output: web pdf
type: homepage
- title: TimeMethods
url: "/TimeMethods.html"
output: web pdf
type: homepage
- title: UART::RxBuffer
url: "/UART_RxBuffer.html"
- title: Time::TimeMethods
url: "/Time_TimeMethods.html"
output: web pdf
type: homepage
- title: VFS
Expand Down
6 changes: 4 additions & 2 deletions lib/rbs_doc/generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ def generate_sidebar(path)
"PRK Firmware class"
when "hardware_device"
"Hardware Device class"
when "error"
"Error class"
else
"General class"
end
Expand Down Expand Up @@ -130,7 +132,7 @@ def generate_pages
f.puts
f.puts "```ruby"
method[:overloads].each do |overload|
f.print classname + "." if kind == :singleton
f.print(kind == :singleton ? classname + "." : "instance.")
f.print name
f.puts overload[:source]
end
Expand All @@ -141,7 +143,7 @@ def generate_pages
klass[:attr_accessors].each do |attr_accessor|
f.puts "### #{attr_accessor[:name]} (#{attr_accessor[:accessor_type]})\n"
f.puts "```ruby"
f.puts attr_accessor[:source]
f.puts "instance.#{attr_accessor[:name]} -> #{attr_accessor[:source]}"
f.puts "```\n"
end
end
Expand Down
18 changes: 4 additions & 14 deletions pages/rbs_doc/ADC.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,34 +14,24 @@ Integer|String|Symbol
Hash[untyped, untyped]
```
## Singleton methods
### _init

```ruby
ADC._init(pin_t pin) -> 0
```
### new

```ruby
ADC.new(pin_t pin, ?additional_params_t additional_params) -> void
ADC.new(pin_t pin, ?additional_params_t additional_params) -> instance
```
## Instance methods
### init_additional_params

```ruby
init_additional_params() -> self
```
### read

```ruby
read() -> Float
instance.read() -> Float
```
### read_raw

```ruby
read_raw() -> Integer
instance.read_raw() -> Integer
```
### read_voltage

```ruby
read_voltage() -> Float
instance.read_voltage() -> Float
```
8 changes: 4 additions & 4 deletions pages/rbs_doc/AHT25.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,21 @@ folder: rbs_doc
### new

```ruby
AHT25.new(i2c: I2C) -> void
AHT25.new(i2c: I2C) -> instance
```
## Instance methods
### check

```ruby
check() -> bool
instance.check() -> bool
```
### read

```ruby
read() -> {temperature: Float, humidity: Float}
instance.read() -> { temperature: Float, humidity: Float }
```
### reset

```ruby
reset() -> void
instance.reset() -> void
```
14 changes: 7 additions & 7 deletions pages/rbs_doc/AQM0802A.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,35 +14,35 @@ AQM0802A.new(i2c: I2C, ?init: bool) -> void
### break_line

```ruby
break_line() -> self
instance.break_line() -> self
```
### clear

```ruby
clear() -> self
instance.clear() -> self
```
### home

```ruby
home() -> self
instance.home() -> self
```
### print

```ruby
print(String line) -> nil
instance.print(String line) -> nil
```
### putc

```ruby
putc(Integer c) -> Integer
instance.putc(Integer c) -> Integer
```
### reset

```ruby
reset() -> self
instance.reset() -> self
```
### write_instruction

```ruby
write_instruction(Integer inst) -> self
instance.write_instruction(Integer inst) -> self
```
Loading

0 comments on commit 11b6e7f

Please sign in to comment.