From 6df93f72fc88f3736fefc29b17c60f72cc5364ac Mon Sep 17 00:00:00 2001 From: kojix2 Date: Wed, 23 Oct 2024 14:10:01 +0000 Subject: [PATCH] deploy: 7736805604c58c44d1ba2070a1e071f49de33d2f --- 404.html | 2 +- Wombat.html | 16 ++++++++-------- Wombat/Error.html | 4 ++-- index.html | 2 +- index.json | 2 +- search-index.js | 2 +- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/404.html b/404.html index 0a67362..738d2fb 100644 --- a/404.html +++ b/404.html @@ -4,7 +4,7 @@ - + diff --git a/Wombat.html b/Wombat.html index a4f3286..f764664 100644 --- a/Wombat.html +++ b/Wombat.html @@ -4,7 +4,7 @@ - + @@ -112,21 +112,21 @@

- + wombat.cr
- + wombat/lib_bat.cr
- + wombat/version.cr @@ -236,7 +236,7 @@


- [View source] + [View source]
@@ -257,7 +257,7 @@


- [View source] + [View source]
@@ -278,7 +278,7 @@


- [View source] + [View source]
@@ -299,7 +299,7 @@


- [View source] + [View source]
diff --git a/Wombat/Error.html b/Wombat/Error.html index e5b147d..d031190 100644 --- a/Wombat/Error.html +++ b/Wombat/Error.html @@ -4,7 +4,7 @@ - + @@ -114,7 +114,7 @@

- + wombat.cr diff --git a/index.html b/index.html index 0b09b4b..9c0721f 100644 --- a/index.html +++ b/index.html @@ -4,7 +4,7 @@ - + diff --git a/index.json b/index.json index 97e19b0..3d6e979 100644 --- a/index.json +++ b/index.json @@ -1 +1 @@ -{"repository_name":"wombat","body":"# Wombat\n\n\n\nWombat is a Crystal binding for the well-known [bat](https://github.com/sharkdp/bat) syntax highlighting library. `bat` is a `cat(1)` clone with wings, popular among developers for its syntax highlighting capabilities. With Wombat, you can utilize `bat`'s syntax highlighting functionality directly within your Crystal applications.\n\n## About `bat`\n\n- [bat](https://github.com/sharkdp/bat): A well-known `cat(1)` clone with syntax highlighting capabilities.\n- [bat-c](https://github.com/kojix2/bat-c): A C wrapper for the `bat` library.\n\n## Installation\n\n1. **Add the dependency to your `shard.yml`:**\n\n ```yaml\n dependencies:\n wombat:\n github: kojix2/wombat\n ```\n\n2. **Install the dependencies:**\n\n ```sh\n shards install\n ```\n\nDuring installation, a `postinstall` script will automatically download the static library for `bat-c` into the `src/ext` directory.\n\n## Usage\n\n### Obtain a Syntax Highlighted String\n\nRetrieve and output a syntax highlighted string:\n\n```crystal\nrequire \"wombat\"\n\nhighlighted = Wombat.pretty_string(%{puts \"hello world\"})\nputs highlighted\n```\n\n### Output a Syntax Highlighted File\n\nOutput the contents of a file with syntax highlighting. `bat` will automatically invoke `less`:\n\n```crystal\nrequire \"wombat\"\n\nWombat.pretty_print_file(\"/path/to/your_file.cr\")\n```\n\nFor more details, refer to the [API Documentation](https://kojix2.github.io/wombat/).\n\n## Development\n\nSustainable development is important. If you encounter any issues or have suggestions for improvement, please contribute!\n\n## Contributing\n\nYour contributions are always welcome! Feel free to raise issues, submit pull requests, or suggest new features.\n","program":{"html_id":"wombat/toplevel","path":"toplevel.html","kind":"module","full_name":"Top Level Namespace","name":"Top Level Namespace","abstract":false,"locations":[],"repository_name":"wombat","program":true,"enum":false,"alias":false,"const":false,"types":[{"html_id":"wombat/Wombat","path":"Wombat.html","kind":"module","full_name":"Wombat","name":"Wombat","abstract":false,"locations":[{"filename":"src/wombat.cr","line_number":4,"url":"https://github.com/kojix2/wombat/blob/4ed3701692801226c93b67ad169d4d8a303141aa/src/wombat.cr#L4"},{"filename":"src/wombat/lib_bat.cr","line_number":1,"url":"https://github.com/kojix2/wombat/blob/4ed3701692801226c93b67ad169d4d8a303141aa/src/wombat/lib_bat.cr#L1"},{"filename":"src/wombat/version.cr","line_number":1,"url":"https://github.com/kojix2/wombat/blob/4ed3701692801226c93b67ad169d4d8a303141aa/src/wombat/version.cr#L1"}],"repository_name":"wombat","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"VERSION","name":"VERSION","value":"{{ (`shards version /home/runner/work/wombat/wombat/src/wombat`).chomp.stringify }}"}],"class_methods":[{"html_id":"bat_c_version:String-class-method","name":"bat_c_version","doc":"Returns the version of the bat_c","summary":"

Returns the version of the bat_c

","abstract":false,"location":{"filename":"src/wombat.cr","line_number":8,"url":"https://github.com/kojix2/wombat/blob/4ed3701692801226c93b67ad169d4d8a303141aa/src/wombat.cr#L8"},"def":{"name":"bat_c_version","return_type":"String","visibility":"Public","body":"String.new(Wombat::Bat.bat_c_version)"}},{"html_id":"pretty_print(input:String,language:String|Nil=nil,theme:String|Nil=nil,tab_width:Int=4,colored_output:Bool=true,true_color:Bool=true,header:Bool=false,line_numbers:Bool=true,grid:Bool=true,rule:Bool=true,show_nonprintable:Bool=false,snip:Bool=true,wrapping_mode:Int=1,use_italics:Bool=true,paging_mode:Int=1,highlight_line:Int=-1):Nil-class-method","name":"pretty_print","doc":"Pretty print the input string","summary":"

Pretty print the input string

","abstract":false,"args":[{"name":"input","external_name":"input","restriction":"String"},{"name":"language","default_value":"nil","external_name":"language","restriction":"String | ::Nil"},{"name":"theme","default_value":"nil","external_name":"theme","restriction":"String | ::Nil"},{"name":"tab_width","default_value":"4","external_name":"tab_width","restriction":"Int"},{"name":"colored_output","default_value":"true","external_name":"colored_output","restriction":"Bool"},{"name":"true_color","default_value":"true","external_name":"true_color","restriction":"Bool"},{"name":"header","default_value":"false","external_name":"header","restriction":"Bool"},{"name":"line_numbers","default_value":"true","external_name":"line_numbers","restriction":"Bool"},{"name":"grid","default_value":"true","external_name":"grid","restriction":"Bool"},{"name":"rule","default_value":"true","external_name":"rule","restriction":"Bool"},{"name":"show_nonprintable","default_value":"false","external_name":"show_nonprintable","restriction":"Bool"},{"name":"snip","default_value":"true","external_name":"snip","restriction":"Bool"},{"name":"wrapping_mode","default_value":"1","external_name":"wrapping_mode","restriction":"Int"},{"name":"use_italics","default_value":"true","external_name":"use_italics","restriction":"Bool"},{"name":"paging_mode","default_value":"1","external_name":"paging_mode","restriction":"Int"},{"name":"highlight_line","default_value":"-1","external_name":"highlight_line","restriction":"Int"}],"args_string":"(input : String, language : String | Nil = nil, theme : String | Nil = nil, tab_width : Int = 4, colored_output : Bool = true, true_color : Bool = true, header : Bool = false, line_numbers : Bool = true, grid : Bool = true, rule : Bool = true, show_nonprintable : Bool = false, snip : Bool = true, wrapping_mode : Int = 1, use_italics : Bool = true, paging_mode : Int = 1, highlight_line : Int = -1) : Nil","args_html":"(input : String, language : String | Nil = nil, theme : String | Nil = nil, tab_width : Int = 4, colored_output : Bool = true, true_color : Bool = true, header : Bool = false, line_numbers : Bool = true, grid : Bool = true, rule : Bool = true, show_nonprintable : Bool = false, snip : Bool = true, wrapping_mode : Int = 1, use_italics : Bool = true, paging_mode : Int = 1, highlight_line : Int = -1) : Nil","location":{"filename":"src/wombat.cr","line_number":13,"url":"https://github.com/kojix2/wombat/blob/4ed3701692801226c93b67ad169d4d8a303141aa/src/wombat.cr#L13"},"def":{"name":"pretty_print","args":[{"name":"input","external_name":"input","restriction":"String"},{"name":"language","default_value":"nil","external_name":"language","restriction":"String | ::Nil"},{"name":"theme","default_value":"nil","external_name":"theme","restriction":"String | ::Nil"},{"name":"tab_width","default_value":"4","external_name":"tab_width","restriction":"Int"},{"name":"colored_output","default_value":"true","external_name":"colored_output","restriction":"Bool"},{"name":"true_color","default_value":"true","external_name":"true_color","restriction":"Bool"},{"name":"header","default_value":"false","external_name":"header","restriction":"Bool"},{"name":"line_numbers","default_value":"true","external_name":"line_numbers","restriction":"Bool"},{"name":"grid","default_value":"true","external_name":"grid","restriction":"Bool"},{"name":"rule","default_value":"true","external_name":"rule","restriction":"Bool"},{"name":"show_nonprintable","default_value":"false","external_name":"show_nonprintable","restriction":"Bool"},{"name":"snip","default_value":"true","external_name":"snip","restriction":"Bool"},{"name":"wrapping_mode","default_value":"1","external_name":"wrapping_mode","restriction":"Int"},{"name":"use_italics","default_value":"true","external_name":"use_italics","restriction":"Bool"},{"name":"paging_mode","default_value":"1","external_name":"paging_mode","restriction":"Int"},{"name":"highlight_line","default_value":"-1","external_name":"highlight_line","restriction":"Int"}],"return_type":"Nil","visibility":"Public","body":"result = Wombat::Bat.bat_pretty_print(input, input.size, Wombat::Bat::BatInputType::BatBytes, language, theme, Wombat::Bat::BatPrintOptions.new(tab_width: tab_width, colored_output: colored_output, true_color: true_color, header: header, line_numbers: line_numbers, grid: grid, rule: rule, show_nonprintable: show_nonprintable, snip: snip, wrapping_mode: wrapping_mode, use_italics: use_italics, paging_mode: paging_mode, highlight_line: highlight_line))\nif result != 0\n raise(Error.new(\"Failed to pretty print input\"))\nend\n"}},{"html_id":"pretty_print_file(path:Path|String,language:String|Nil=nil,theme:String|Nil=nil,tab_width:Int=4,colored_output:Bool=true,true_color:Bool=true,header:Bool=true,line_numbers:Bool=true,grid:Bool=true,rule:Bool=true,show_nonprintable:Bool=false,snip:Bool=true,wrapping_mode:Int=1,use_italics:Bool=true,paging_mode:Int=1,highlight_line:Int=-1):Nil-class-method","name":"pretty_print_file","doc":"Pretty print the input file","summary":"

Pretty print the input file

","abstract":false,"args":[{"name":"path","external_name":"path","restriction":"Path | String"},{"name":"language","default_value":"nil","external_name":"language","restriction":"String | ::Nil"},{"name":"theme","default_value":"nil","external_name":"theme","restriction":"String | ::Nil"},{"name":"tab_width","default_value":"4","external_name":"tab_width","restriction":"Int"},{"name":"colored_output","default_value":"true","external_name":"colored_output","restriction":"Bool"},{"name":"true_color","default_value":"true","external_name":"true_color","restriction":"Bool"},{"name":"header","default_value":"true","external_name":"header","restriction":"Bool"},{"name":"line_numbers","default_value":"true","external_name":"line_numbers","restriction":"Bool"},{"name":"grid","default_value":"true","external_name":"grid","restriction":"Bool"},{"name":"rule","default_value":"true","external_name":"rule","restriction":"Bool"},{"name":"show_nonprintable","default_value":"false","external_name":"show_nonprintable","restriction":"Bool"},{"name":"snip","default_value":"true","external_name":"snip","restriction":"Bool"},{"name":"wrapping_mode","default_value":"1","external_name":"wrapping_mode","restriction":"Int"},{"name":"use_italics","default_value":"true","external_name":"use_italics","restriction":"Bool"},{"name":"paging_mode","default_value":"1","external_name":"paging_mode","restriction":"Int"},{"name":"highlight_line","default_value":"-1","external_name":"highlight_line","restriction":"Int"}],"args_string":"(path : Path | String, language : String | Nil = nil, theme : String | Nil = nil, tab_width : Int = 4, colored_output : Bool = true, true_color : Bool = true, header : Bool = true, line_numbers : Bool = true, grid : Bool = true, rule : Bool = true, show_nonprintable : Bool = false, snip : Bool = true, wrapping_mode : Int = 1, use_italics : Bool = true, paging_mode : Int = 1, highlight_line : Int = -1) : Nil","args_html":"(path : Path | String, language : String | Nil = nil, theme : String | Nil = nil, tab_width : Int = 4, colored_output : Bool = true, true_color : Bool = true, header : Bool = true, line_numbers : Bool = true, grid : Bool = true, rule : Bool = true, show_nonprintable : Bool = false, snip : Bool = true, wrapping_mode : Int = 1, use_italics : Bool = true, paging_mode : Int = 1, highlight_line : Int = -1) : Nil","location":{"filename":"src/wombat.cr","line_number":59,"url":"https://github.com/kojix2/wombat/blob/4ed3701692801226c93b67ad169d4d8a303141aa/src/wombat.cr#L59"},"def":{"name":"pretty_print_file","args":[{"name":"path","external_name":"path","restriction":"Path | String"},{"name":"language","default_value":"nil","external_name":"language","restriction":"String | ::Nil"},{"name":"theme","default_value":"nil","external_name":"theme","restriction":"String | ::Nil"},{"name":"tab_width","default_value":"4","external_name":"tab_width","restriction":"Int"},{"name":"colored_output","default_value":"true","external_name":"colored_output","restriction":"Bool"},{"name":"true_color","default_value":"true","external_name":"true_color","restriction":"Bool"},{"name":"header","default_value":"true","external_name":"header","restriction":"Bool"},{"name":"line_numbers","default_value":"true","external_name":"line_numbers","restriction":"Bool"},{"name":"grid","default_value":"true","external_name":"grid","restriction":"Bool"},{"name":"rule","default_value":"true","external_name":"rule","restriction":"Bool"},{"name":"show_nonprintable","default_value":"false","external_name":"show_nonprintable","restriction":"Bool"},{"name":"snip","default_value":"true","external_name":"snip","restriction":"Bool"},{"name":"wrapping_mode","default_value":"1","external_name":"wrapping_mode","restriction":"Int"},{"name":"use_italics","default_value":"true","external_name":"use_italics","restriction":"Bool"},{"name":"paging_mode","default_value":"1","external_name":"paging_mode","restriction":"Int"},{"name":"highlight_line","default_value":"-1","external_name":"highlight_line","restriction":"Int"}],"return_type":"Nil","visibility":"Public","body":"result = Wombat::Bat.bat_pretty_print(path.to_s, path.to_s.size, Wombat::Bat::BatInputType::BatFile, language, theme, Wombat::Bat::BatPrintOptions.new(tab_width: tab_width, colored_output: colored_output, true_color: true_color, header: header, line_numbers: line_numbers, grid: grid, rule: rule, show_nonprintable: show_nonprintable, snip: snip, wrapping_mode: wrapping_mode, use_italics: use_italics, paging_mode: paging_mode, highlight_line: highlight_line))\nif result != 0\n raise(Error.new(\"Failed to pretty print file : #{path}\"))\nend\n"}},{"html_id":"pretty_string(input:String,language:String|Nil=nil,theme:String|Nil=nil,tab_width:Int=4,colored_output:Bool=true,true_color:Bool=true,header:Bool=false,line_numbers:Bool=true,grid:Bool=true,rule:Bool=true,show_nonprintable:Bool=false,snip:Bool=true,wrapping_mode:Int=1,use_italics:Bool=true,paging_mode:Int=2,highlight_line:Int=-1):String-class-method","name":"pretty_string","doc":"Get the highlighted string of the input","summary":"

Get the highlighted string of the input

","abstract":false,"args":[{"name":"input","external_name":"input","restriction":"String"},{"name":"language","default_value":"nil","external_name":"language","restriction":"String | ::Nil"},{"name":"theme","default_value":"nil","external_name":"theme","restriction":"String | ::Nil"},{"name":"tab_width","default_value":"4","external_name":"tab_width","restriction":"Int"},{"name":"colored_output","default_value":"true","external_name":"colored_output","restriction":"Bool"},{"name":"true_color","default_value":"true","external_name":"true_color","restriction":"Bool"},{"name":"header","default_value":"false","external_name":"header","restriction":"Bool"},{"name":"line_numbers","default_value":"true","external_name":"line_numbers","restriction":"Bool"},{"name":"grid","default_value":"true","external_name":"grid","restriction":"Bool"},{"name":"rule","default_value":"true","external_name":"rule","restriction":"Bool"},{"name":"show_nonprintable","default_value":"false","external_name":"show_nonprintable","restriction":"Bool"},{"name":"snip","default_value":"true","external_name":"snip","restriction":"Bool"},{"name":"wrapping_mode","default_value":"1","external_name":"wrapping_mode","restriction":"Int"},{"name":"use_italics","default_value":"true","external_name":"use_italics","restriction":"Bool"},{"name":"paging_mode","default_value":"2","external_name":"paging_mode","restriction":"Int"},{"name":"highlight_line","default_value":"-1","external_name":"highlight_line","restriction":"Int"}],"args_string":"(input : String, language : String | Nil = nil, theme : String | Nil = nil, tab_width : Int = 4, colored_output : Bool = true, true_color : Bool = true, header : Bool = false, line_numbers : Bool = true, grid : Bool = true, rule : Bool = true, show_nonprintable : Bool = false, snip : Bool = true, wrapping_mode : Int = 1, use_italics : Bool = true, paging_mode : Int = 2, highlight_line : Int = -1) : String","args_html":"(input : String, language : String | Nil = nil, theme : String | Nil = nil, tab_width : Int = 4, colored_output : Bool = true, true_color : Bool = true, header : Bool = false, line_numbers : Bool = true, grid : Bool = true, rule : Bool = true, show_nonprintable : Bool = false, snip : Bool = true, wrapping_mode : Int = 1, use_italics : Bool = true, paging_mode : Int = 2, highlight_line : Int = -1) : String","location":{"filename":"src/wombat.cr","line_number":105,"url":"https://github.com/kojix2/wombat/blob/4ed3701692801226c93b67ad169d4d8a303141aa/src/wombat.cr#L105"},"def":{"name":"pretty_string","args":[{"name":"input","external_name":"input","restriction":"String"},{"name":"language","default_value":"nil","external_name":"language","restriction":"String | ::Nil"},{"name":"theme","default_value":"nil","external_name":"theme","restriction":"String | ::Nil"},{"name":"tab_width","default_value":"4","external_name":"tab_width","restriction":"Int"},{"name":"colored_output","default_value":"true","external_name":"colored_output","restriction":"Bool"},{"name":"true_color","default_value":"true","external_name":"true_color","restriction":"Bool"},{"name":"header","default_value":"false","external_name":"header","restriction":"Bool"},{"name":"line_numbers","default_value":"true","external_name":"line_numbers","restriction":"Bool"},{"name":"grid","default_value":"true","external_name":"grid","restriction":"Bool"},{"name":"rule","default_value":"true","external_name":"rule","restriction":"Bool"},{"name":"show_nonprintable","default_value":"false","external_name":"show_nonprintable","restriction":"Bool"},{"name":"snip","default_value":"true","external_name":"snip","restriction":"Bool"},{"name":"wrapping_mode","default_value":"1","external_name":"wrapping_mode","restriction":"Int"},{"name":"use_italics","default_value":"true","external_name":"use_italics","restriction":"Bool"},{"name":"paging_mode","default_value":"2","external_name":"paging_mode","restriction":"Int"},{"name":"highlight_line","default_value":"-1","external_name":"highlight_line","restriction":"Int"}],"return_type":"String","visibility":"Public","body":"len_ptr = Pointer(LibC::SizeT).malloc\noutput_ptr = Pointer(Pointer(UInt8)).malloc\nresult = Wombat::Bat.bat_pretty_print_to_string(input, input.size, Wombat::Bat::BatInputType::BatBytes, language, theme, Wombat::Bat::BatPrintOptions.new(tab_width: tab_width, colored_output: colored_output, true_color: true_color, header: header, line_numbers: line_numbers, grid: grid, rule: rule, show_nonprintable: show_nonprintable, snip: snip, wrapping_mode: wrapping_mode, use_italics: use_italics, paging_mode: paging_mode, highlight_line: highlight_line), output_ptr, len_ptr)\nif result != 0\n raise(Error.new(\"Failed to highlight input\"))\nend\nstr = String.new(output_ptr.value, len_ptr.value)\nWombat::Bat.bat_free_string(output_ptr.value)\nstr\n"}}],"types":[{"html_id":"wombat/Wombat/Error","path":"Wombat/Error.html","kind":"class","full_name":"Wombat::Error","name":"Error","abstract":false,"superclass":{"html_id":"wombat/Exception","kind":"class","full_name":"Exception","name":"Exception"},"ancestors":[{"html_id":"wombat/Exception","kind":"class","full_name":"Exception","name":"Exception"},{"html_id":"wombat/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"wombat/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/wombat.cr","line_number":5,"url":"https://github.com/kojix2/wombat/blob/4ed3701692801226c93b67ad169d4d8a303141aa/src/wombat.cr#L5"}],"repository_name":"wombat","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"wombat/Wombat","kind":"module","full_name":"Wombat","name":"Wombat"}}]}]}} \ No newline at end of file +{"repository_name":"wombat","body":"# Wombat\n\n\n\nWombat is a Crystal binding for the well-known [bat](https://github.com/sharkdp/bat) syntax highlighting library. `bat` is a `cat(1)` clone with wings, popular among developers for its syntax highlighting capabilities. With Wombat, you can utilize `bat`'s syntax highlighting functionality directly within your Crystal applications.\n\n## About `bat`\n\n- [bat](https://github.com/sharkdp/bat): A well-known `cat(1)` clone with syntax highlighting capabilities.\n- [bat-c](https://github.com/kojix2/bat-c): A C wrapper for the `bat` library.\n\n## Installation\n\n1. **Add the dependency to your `shard.yml`:**\n\n ```yaml\n dependencies:\n wombat:\n github: kojix2/wombat\n ```\n\n2. **Install the dependencies:**\n\n ```sh\n shards install\n ```\n\nDuring installation, a `postinstall` script will automatically download the static library for `bat-c` into the `src/ext` directory.\n\n## Usage\n\n### Obtain a Syntax Highlighted String\n\nRetrieve and output a syntax highlighted string:\n\n```crystal\nrequire \"wombat\"\n\nhighlighted = Wombat.pretty_string(%{puts \"hello world\"})\nputs highlighted\n```\n\n### Output a Syntax Highlighted File\n\nOutput the contents of a file with syntax highlighting. `bat` will automatically invoke `less`:\n\n```crystal\nrequire \"wombat\"\n\nWombat.pretty_print_file(\"/path/to/your_file.cr\")\n```\n\nFor more details, refer to the [API Documentation](https://kojix2.github.io/wombat/).\n\n## Development\n\nSustainable development is important. If you encounter any issues or have suggestions for improvement, please contribute!\n\n## Contributing\n\nYour contributions are always welcome! Feel free to raise issues, submit pull requests, or suggest new features.\n","program":{"html_id":"wombat/toplevel","path":"toplevel.html","kind":"module","full_name":"Top Level Namespace","name":"Top Level Namespace","abstract":false,"locations":[],"repository_name":"wombat","program":true,"enum":false,"alias":false,"const":false,"types":[{"html_id":"wombat/Wombat","path":"Wombat.html","kind":"module","full_name":"Wombat","name":"Wombat","abstract":false,"locations":[{"filename":"src/wombat.cr","line_number":4,"url":"https://github.com/kojix2/wombat/blob/7736805604c58c44d1ba2070a1e071f49de33d2f/src/wombat.cr#L4"},{"filename":"src/wombat/lib_bat.cr","line_number":1,"url":"https://github.com/kojix2/wombat/blob/7736805604c58c44d1ba2070a1e071f49de33d2f/src/wombat/lib_bat.cr#L1"},{"filename":"src/wombat/version.cr","line_number":1,"url":"https://github.com/kojix2/wombat/blob/7736805604c58c44d1ba2070a1e071f49de33d2f/src/wombat/version.cr#L1"}],"repository_name":"wombat","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"VERSION","name":"VERSION","value":"{{ (`shards version /home/runner/work/wombat/wombat/src/wombat`).chomp.stringify }}"}],"class_methods":[{"html_id":"bat_c_version:String-class-method","name":"bat_c_version","doc":"Returns the version of the bat_c","summary":"

Returns the version of the bat_c

","abstract":false,"location":{"filename":"src/wombat.cr","line_number":8,"url":"https://github.com/kojix2/wombat/blob/7736805604c58c44d1ba2070a1e071f49de33d2f/src/wombat.cr#L8"},"def":{"name":"bat_c_version","return_type":"String","visibility":"Public","body":"String.new(Wombat::Bat.bat_c_version)"}},{"html_id":"pretty_print(input:String,language:String|Nil=nil,theme:String|Nil=nil,tab_width:Int=4,colored_output:Bool=true,true_color:Bool=true,header:Bool=false,line_numbers:Bool=true,grid:Bool=true,rule:Bool=true,show_nonprintable:Bool=false,snip:Bool=true,wrapping_mode:Int=1,use_italics:Bool=true,paging_mode:Int=1,highlight_line:Int=-1):Nil-class-method","name":"pretty_print","doc":"Pretty print the input string","summary":"

Pretty print the input string

","abstract":false,"args":[{"name":"input","external_name":"input","restriction":"String"},{"name":"language","default_value":"nil","external_name":"language","restriction":"String | ::Nil"},{"name":"theme","default_value":"nil","external_name":"theme","restriction":"String | ::Nil"},{"name":"tab_width","default_value":"4","external_name":"tab_width","restriction":"Int"},{"name":"colored_output","default_value":"true","external_name":"colored_output","restriction":"Bool"},{"name":"true_color","default_value":"true","external_name":"true_color","restriction":"Bool"},{"name":"header","default_value":"false","external_name":"header","restriction":"Bool"},{"name":"line_numbers","default_value":"true","external_name":"line_numbers","restriction":"Bool"},{"name":"grid","default_value":"true","external_name":"grid","restriction":"Bool"},{"name":"rule","default_value":"true","external_name":"rule","restriction":"Bool"},{"name":"show_nonprintable","default_value":"false","external_name":"show_nonprintable","restriction":"Bool"},{"name":"snip","default_value":"true","external_name":"snip","restriction":"Bool"},{"name":"wrapping_mode","default_value":"1","external_name":"wrapping_mode","restriction":"Int"},{"name":"use_italics","default_value":"true","external_name":"use_italics","restriction":"Bool"},{"name":"paging_mode","default_value":"1","external_name":"paging_mode","restriction":"Int"},{"name":"highlight_line","default_value":"-1","external_name":"highlight_line","restriction":"Int"}],"args_string":"(input : String, language : String | Nil = nil, theme : String | Nil = nil, tab_width : Int = 4, colored_output : Bool = true, true_color : Bool = true, header : Bool = false, line_numbers : Bool = true, grid : Bool = true, rule : Bool = true, show_nonprintable : Bool = false, snip : Bool = true, wrapping_mode : Int = 1, use_italics : Bool = true, paging_mode : Int = 1, highlight_line : Int = -1) : Nil","args_html":"(input : String, language : String | Nil = nil, theme : String | Nil = nil, tab_width : Int = 4, colored_output : Bool = true, true_color : Bool = true, header : Bool = false, line_numbers : Bool = true, grid : Bool = true, rule : Bool = true, show_nonprintable : Bool = false, snip : Bool = true, wrapping_mode : Int = 1, use_italics : Bool = true, paging_mode : Int = 1, highlight_line : Int = -1) : Nil","location":{"filename":"src/wombat.cr","line_number":13,"url":"https://github.com/kojix2/wombat/blob/7736805604c58c44d1ba2070a1e071f49de33d2f/src/wombat.cr#L13"},"def":{"name":"pretty_print","args":[{"name":"input","external_name":"input","restriction":"String"},{"name":"language","default_value":"nil","external_name":"language","restriction":"String | ::Nil"},{"name":"theme","default_value":"nil","external_name":"theme","restriction":"String | ::Nil"},{"name":"tab_width","default_value":"4","external_name":"tab_width","restriction":"Int"},{"name":"colored_output","default_value":"true","external_name":"colored_output","restriction":"Bool"},{"name":"true_color","default_value":"true","external_name":"true_color","restriction":"Bool"},{"name":"header","default_value":"false","external_name":"header","restriction":"Bool"},{"name":"line_numbers","default_value":"true","external_name":"line_numbers","restriction":"Bool"},{"name":"grid","default_value":"true","external_name":"grid","restriction":"Bool"},{"name":"rule","default_value":"true","external_name":"rule","restriction":"Bool"},{"name":"show_nonprintable","default_value":"false","external_name":"show_nonprintable","restriction":"Bool"},{"name":"snip","default_value":"true","external_name":"snip","restriction":"Bool"},{"name":"wrapping_mode","default_value":"1","external_name":"wrapping_mode","restriction":"Int"},{"name":"use_italics","default_value":"true","external_name":"use_italics","restriction":"Bool"},{"name":"paging_mode","default_value":"1","external_name":"paging_mode","restriction":"Int"},{"name":"highlight_line","default_value":"-1","external_name":"highlight_line","restriction":"Int"}],"return_type":"Nil","visibility":"Public","body":"result = Wombat::Bat.bat_pretty_print(input, input.size, Wombat::Bat::BatInputType::BatBytes, language, theme, Wombat::Bat::BatPrintOptions.new(tab_width: tab_width, colored_output: colored_output, true_color: true_color, header: header, line_numbers: line_numbers, grid: grid, rule: rule, show_nonprintable: show_nonprintable, snip: snip, wrapping_mode: wrapping_mode, use_italics: use_italics, paging_mode: paging_mode, highlight_line: highlight_line))\nif result != 0\n raise(Error.new(\"Failed to pretty print input\"))\nend\n"}},{"html_id":"pretty_print_file(path:Path|String,language:String|Nil=nil,theme:String|Nil=nil,tab_width:Int=4,colored_output:Bool=true,true_color:Bool=true,header:Bool=true,line_numbers:Bool=true,grid:Bool=true,rule:Bool=true,show_nonprintable:Bool=false,snip:Bool=true,wrapping_mode:Int=1,use_italics:Bool=true,paging_mode:Int=1,highlight_line:Int=-1):Nil-class-method","name":"pretty_print_file","doc":"Pretty print the input file","summary":"

Pretty print the input file

","abstract":false,"args":[{"name":"path","external_name":"path","restriction":"Path | String"},{"name":"language","default_value":"nil","external_name":"language","restriction":"String | ::Nil"},{"name":"theme","default_value":"nil","external_name":"theme","restriction":"String | ::Nil"},{"name":"tab_width","default_value":"4","external_name":"tab_width","restriction":"Int"},{"name":"colored_output","default_value":"true","external_name":"colored_output","restriction":"Bool"},{"name":"true_color","default_value":"true","external_name":"true_color","restriction":"Bool"},{"name":"header","default_value":"true","external_name":"header","restriction":"Bool"},{"name":"line_numbers","default_value":"true","external_name":"line_numbers","restriction":"Bool"},{"name":"grid","default_value":"true","external_name":"grid","restriction":"Bool"},{"name":"rule","default_value":"true","external_name":"rule","restriction":"Bool"},{"name":"show_nonprintable","default_value":"false","external_name":"show_nonprintable","restriction":"Bool"},{"name":"snip","default_value":"true","external_name":"snip","restriction":"Bool"},{"name":"wrapping_mode","default_value":"1","external_name":"wrapping_mode","restriction":"Int"},{"name":"use_italics","default_value":"true","external_name":"use_italics","restriction":"Bool"},{"name":"paging_mode","default_value":"1","external_name":"paging_mode","restriction":"Int"},{"name":"highlight_line","default_value":"-1","external_name":"highlight_line","restriction":"Int"}],"args_string":"(path : Path | String, language : String | Nil = nil, theme : String | Nil = nil, tab_width : Int = 4, colored_output : Bool = true, true_color : Bool = true, header : Bool = true, line_numbers : Bool = true, grid : Bool = true, rule : Bool = true, show_nonprintable : Bool = false, snip : Bool = true, wrapping_mode : Int = 1, use_italics : Bool = true, paging_mode : Int = 1, highlight_line : Int = -1) : Nil","args_html":"(path : Path | String, language : String | Nil = nil, theme : String | Nil = nil, tab_width : Int = 4, colored_output : Bool = true, true_color : Bool = true, header : Bool = true, line_numbers : Bool = true, grid : Bool = true, rule : Bool = true, show_nonprintable : Bool = false, snip : Bool = true, wrapping_mode : Int = 1, use_italics : Bool = true, paging_mode : Int = 1, highlight_line : Int = -1) : Nil","location":{"filename":"src/wombat.cr","line_number":59,"url":"https://github.com/kojix2/wombat/blob/7736805604c58c44d1ba2070a1e071f49de33d2f/src/wombat.cr#L59"},"def":{"name":"pretty_print_file","args":[{"name":"path","external_name":"path","restriction":"Path | String"},{"name":"language","default_value":"nil","external_name":"language","restriction":"String | ::Nil"},{"name":"theme","default_value":"nil","external_name":"theme","restriction":"String | ::Nil"},{"name":"tab_width","default_value":"4","external_name":"tab_width","restriction":"Int"},{"name":"colored_output","default_value":"true","external_name":"colored_output","restriction":"Bool"},{"name":"true_color","default_value":"true","external_name":"true_color","restriction":"Bool"},{"name":"header","default_value":"true","external_name":"header","restriction":"Bool"},{"name":"line_numbers","default_value":"true","external_name":"line_numbers","restriction":"Bool"},{"name":"grid","default_value":"true","external_name":"grid","restriction":"Bool"},{"name":"rule","default_value":"true","external_name":"rule","restriction":"Bool"},{"name":"show_nonprintable","default_value":"false","external_name":"show_nonprintable","restriction":"Bool"},{"name":"snip","default_value":"true","external_name":"snip","restriction":"Bool"},{"name":"wrapping_mode","default_value":"1","external_name":"wrapping_mode","restriction":"Int"},{"name":"use_italics","default_value":"true","external_name":"use_italics","restriction":"Bool"},{"name":"paging_mode","default_value":"1","external_name":"paging_mode","restriction":"Int"},{"name":"highlight_line","default_value":"-1","external_name":"highlight_line","restriction":"Int"}],"return_type":"Nil","visibility":"Public","body":"result = Wombat::Bat.bat_pretty_print(path.to_s, path.to_s.size, Wombat::Bat::BatInputType::BatFile, language, theme, Wombat::Bat::BatPrintOptions.new(tab_width: tab_width, colored_output: colored_output, true_color: true_color, header: header, line_numbers: line_numbers, grid: grid, rule: rule, show_nonprintable: show_nonprintable, snip: snip, wrapping_mode: wrapping_mode, use_italics: use_italics, paging_mode: paging_mode, highlight_line: highlight_line))\nif result != 0\n raise(Error.new(\"Failed to pretty print file : #{path}\"))\nend\n"}},{"html_id":"pretty_string(input:String,language:String|Nil=nil,theme:String|Nil=nil,tab_width:Int=4,colored_output:Bool=true,true_color:Bool=true,header:Bool=false,line_numbers:Bool=true,grid:Bool=true,rule:Bool=true,show_nonprintable:Bool=false,snip:Bool=true,wrapping_mode:Int=1,use_italics:Bool=true,paging_mode:Int=2,highlight_line:Int=-1):String-class-method","name":"pretty_string","doc":"Get the highlighted string of the input","summary":"

Get the highlighted string of the input

","abstract":false,"args":[{"name":"input","external_name":"input","restriction":"String"},{"name":"language","default_value":"nil","external_name":"language","restriction":"String | ::Nil"},{"name":"theme","default_value":"nil","external_name":"theme","restriction":"String | ::Nil"},{"name":"tab_width","default_value":"4","external_name":"tab_width","restriction":"Int"},{"name":"colored_output","default_value":"true","external_name":"colored_output","restriction":"Bool"},{"name":"true_color","default_value":"true","external_name":"true_color","restriction":"Bool"},{"name":"header","default_value":"false","external_name":"header","restriction":"Bool"},{"name":"line_numbers","default_value":"true","external_name":"line_numbers","restriction":"Bool"},{"name":"grid","default_value":"true","external_name":"grid","restriction":"Bool"},{"name":"rule","default_value":"true","external_name":"rule","restriction":"Bool"},{"name":"show_nonprintable","default_value":"false","external_name":"show_nonprintable","restriction":"Bool"},{"name":"snip","default_value":"true","external_name":"snip","restriction":"Bool"},{"name":"wrapping_mode","default_value":"1","external_name":"wrapping_mode","restriction":"Int"},{"name":"use_italics","default_value":"true","external_name":"use_italics","restriction":"Bool"},{"name":"paging_mode","default_value":"2","external_name":"paging_mode","restriction":"Int"},{"name":"highlight_line","default_value":"-1","external_name":"highlight_line","restriction":"Int"}],"args_string":"(input : String, language : String | Nil = nil, theme : String | Nil = nil, tab_width : Int = 4, colored_output : Bool = true, true_color : Bool = true, header : Bool = false, line_numbers : Bool = true, grid : Bool = true, rule : Bool = true, show_nonprintable : Bool = false, snip : Bool = true, wrapping_mode : Int = 1, use_italics : Bool = true, paging_mode : Int = 2, highlight_line : Int = -1) : String","args_html":"(input : String, language : String | Nil = nil, theme : String | Nil = nil, tab_width : Int = 4, colored_output : Bool = true, true_color : Bool = true, header : Bool = false, line_numbers : Bool = true, grid : Bool = true, rule : Bool = true, show_nonprintable : Bool = false, snip : Bool = true, wrapping_mode : Int = 1, use_italics : Bool = true, paging_mode : Int = 2, highlight_line : Int = -1) : String","location":{"filename":"src/wombat.cr","line_number":105,"url":"https://github.com/kojix2/wombat/blob/7736805604c58c44d1ba2070a1e071f49de33d2f/src/wombat.cr#L105"},"def":{"name":"pretty_string","args":[{"name":"input","external_name":"input","restriction":"String"},{"name":"language","default_value":"nil","external_name":"language","restriction":"String | ::Nil"},{"name":"theme","default_value":"nil","external_name":"theme","restriction":"String | ::Nil"},{"name":"tab_width","default_value":"4","external_name":"tab_width","restriction":"Int"},{"name":"colored_output","default_value":"true","external_name":"colored_output","restriction":"Bool"},{"name":"true_color","default_value":"true","external_name":"true_color","restriction":"Bool"},{"name":"header","default_value":"false","external_name":"header","restriction":"Bool"},{"name":"line_numbers","default_value":"true","external_name":"line_numbers","restriction":"Bool"},{"name":"grid","default_value":"true","external_name":"grid","restriction":"Bool"},{"name":"rule","default_value":"true","external_name":"rule","restriction":"Bool"},{"name":"show_nonprintable","default_value":"false","external_name":"show_nonprintable","restriction":"Bool"},{"name":"snip","default_value":"true","external_name":"snip","restriction":"Bool"},{"name":"wrapping_mode","default_value":"1","external_name":"wrapping_mode","restriction":"Int"},{"name":"use_italics","default_value":"true","external_name":"use_italics","restriction":"Bool"},{"name":"paging_mode","default_value":"2","external_name":"paging_mode","restriction":"Int"},{"name":"highlight_line","default_value":"-1","external_name":"highlight_line","restriction":"Int"}],"return_type":"String","visibility":"Public","body":"len_ptr = Pointer(LibC::SizeT).malloc\noutput_ptr = Pointer(Pointer(UInt8)).malloc\nresult = Wombat::Bat.bat_pretty_print_to_string(input, input.size, Wombat::Bat::BatInputType::BatBytes, language, theme, Wombat::Bat::BatPrintOptions.new(tab_width: tab_width, colored_output: colored_output, true_color: true_color, header: header, line_numbers: line_numbers, grid: grid, rule: rule, show_nonprintable: show_nonprintable, snip: snip, wrapping_mode: wrapping_mode, use_italics: use_italics, paging_mode: paging_mode, highlight_line: highlight_line), output_ptr, len_ptr)\nif result != 0\n raise(Error.new(\"Failed to highlight input\"))\nend\nstr = String.new(output_ptr.value, len_ptr.value)\nWombat::Bat.bat_free_string(output_ptr.value)\nstr\n"}}],"types":[{"html_id":"wombat/Wombat/Error","path":"Wombat/Error.html","kind":"class","full_name":"Wombat::Error","name":"Error","abstract":false,"superclass":{"html_id":"wombat/Exception","kind":"class","full_name":"Exception","name":"Exception"},"ancestors":[{"html_id":"wombat/Exception","kind":"class","full_name":"Exception","name":"Exception"},{"html_id":"wombat/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"wombat/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/wombat.cr","line_number":5,"url":"https://github.com/kojix2/wombat/blob/7736805604c58c44d1ba2070a1e071f49de33d2f/src/wombat.cr#L5"}],"repository_name":"wombat","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"wombat/Wombat","kind":"module","full_name":"Wombat","name":"Wombat"}}]}]}} \ No newline at end of file diff --git a/search-index.js b/search-index.js index 55eb5c5..ae56c4c 100644 --- a/search-index.js +++ b/search-index.js @@ -1 +1 @@ -crystal_doc_search_index_callback({"repository_name":"wombat","body":"# Wombat\n\n\n\nWombat is a Crystal binding for the well-known [bat](https://github.com/sharkdp/bat) syntax highlighting library. `bat` is a `cat(1)` clone with wings, popular among developers for its syntax highlighting capabilities. With Wombat, you can utilize `bat`'s syntax highlighting functionality directly within your Crystal applications.\n\n## About `bat`\n\n- [bat](https://github.com/sharkdp/bat): A well-known `cat(1)` clone with syntax highlighting capabilities.\n- [bat-c](https://github.com/kojix2/bat-c): A C wrapper for the `bat` library.\n\n## Installation\n\n1. **Add the dependency to your `shard.yml`:**\n\n ```yaml\n dependencies:\n wombat:\n github: kojix2/wombat\n ```\n\n2. **Install the dependencies:**\n\n ```sh\n shards install\n ```\n\nDuring installation, a `postinstall` script will automatically download the static library for `bat-c` into the `src/ext` directory.\n\n## Usage\n\n### Obtain a Syntax Highlighted String\n\nRetrieve and output a syntax highlighted string:\n\n```crystal\nrequire \"wombat\"\n\nhighlighted = Wombat.pretty_string(%{puts \"hello world\"})\nputs highlighted\n```\n\n### Output a Syntax Highlighted File\n\nOutput the contents of a file with syntax highlighting. `bat` will automatically invoke `less`:\n\n```crystal\nrequire \"wombat\"\n\nWombat.pretty_print_file(\"/path/to/your_file.cr\")\n```\n\nFor more details, refer to the [API Documentation](https://kojix2.github.io/wombat/).\n\n## Development\n\nSustainable development is important. If you encounter any issues or have suggestions for improvement, please contribute!\n\n## Contributing\n\nYour contributions are always welcome! Feel free to raise issues, submit pull requests, or suggest new features.\n","program":{"html_id":"wombat/toplevel","path":"toplevel.html","kind":"module","full_name":"Top Level Namespace","name":"Top Level Namespace","abstract":false,"locations":[],"repository_name":"wombat","program":true,"enum":false,"alias":false,"const":false,"types":[{"html_id":"wombat/Wombat","path":"Wombat.html","kind":"module","full_name":"Wombat","name":"Wombat","abstract":false,"locations":[{"filename":"src/wombat.cr","line_number":4,"url":"https://github.com/kojix2/wombat/blob/4ed3701692801226c93b67ad169d4d8a303141aa/src/wombat.cr#L4"},{"filename":"src/wombat/lib_bat.cr","line_number":1,"url":"https://github.com/kojix2/wombat/blob/4ed3701692801226c93b67ad169d4d8a303141aa/src/wombat/lib_bat.cr#L1"},{"filename":"src/wombat/version.cr","line_number":1,"url":"https://github.com/kojix2/wombat/blob/4ed3701692801226c93b67ad169d4d8a303141aa/src/wombat/version.cr#L1"}],"repository_name":"wombat","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"VERSION","name":"VERSION","value":"{{ (`shards version /home/runner/work/wombat/wombat/src/wombat`).chomp.stringify }}"}],"class_methods":[{"html_id":"bat_c_version:String-class-method","name":"bat_c_version","doc":"Returns the version of the bat_c","summary":"

Returns the version of the bat_c

","abstract":false,"location":{"filename":"src/wombat.cr","line_number":8,"url":"https://github.com/kojix2/wombat/blob/4ed3701692801226c93b67ad169d4d8a303141aa/src/wombat.cr#L8"},"def":{"name":"bat_c_version","return_type":"String","visibility":"Public","body":"String.new(Wombat::Bat.bat_c_version)"}},{"html_id":"pretty_print(input:String,language:String|Nil=nil,theme:String|Nil=nil,tab_width:Int=4,colored_output:Bool=true,true_color:Bool=true,header:Bool=false,line_numbers:Bool=true,grid:Bool=true,rule:Bool=true,show_nonprintable:Bool=false,snip:Bool=true,wrapping_mode:Int=1,use_italics:Bool=true,paging_mode:Int=1,highlight_line:Int=-1):Nil-class-method","name":"pretty_print","doc":"Pretty print the input string","summary":"

Pretty print the input string

","abstract":false,"args":[{"name":"input","external_name":"input","restriction":"String"},{"name":"language","default_value":"nil","external_name":"language","restriction":"String | ::Nil"},{"name":"theme","default_value":"nil","external_name":"theme","restriction":"String | ::Nil"},{"name":"tab_width","default_value":"4","external_name":"tab_width","restriction":"Int"},{"name":"colored_output","default_value":"true","external_name":"colored_output","restriction":"Bool"},{"name":"true_color","default_value":"true","external_name":"true_color","restriction":"Bool"},{"name":"header","default_value":"false","external_name":"header","restriction":"Bool"},{"name":"line_numbers","default_value":"true","external_name":"line_numbers","restriction":"Bool"},{"name":"grid","default_value":"true","external_name":"grid","restriction":"Bool"},{"name":"rule","default_value":"true","external_name":"rule","restriction":"Bool"},{"name":"show_nonprintable","default_value":"false","external_name":"show_nonprintable","restriction":"Bool"},{"name":"snip","default_value":"true","external_name":"snip","restriction":"Bool"},{"name":"wrapping_mode","default_value":"1","external_name":"wrapping_mode","restriction":"Int"},{"name":"use_italics","default_value":"true","external_name":"use_italics","restriction":"Bool"},{"name":"paging_mode","default_value":"1","external_name":"paging_mode","restriction":"Int"},{"name":"highlight_line","default_value":"-1","external_name":"highlight_line","restriction":"Int"}],"args_string":"(input : String, language : String | Nil = nil, theme : String | Nil = nil, tab_width : Int = 4, colored_output : Bool = true, true_color : Bool = true, header : Bool = false, line_numbers : Bool = true, grid : Bool = true, rule : Bool = true, show_nonprintable : Bool = false, snip : Bool = true, wrapping_mode : Int = 1, use_italics : Bool = true, paging_mode : Int = 1, highlight_line : Int = -1) : Nil","args_html":"(input : String, language : String | Nil = nil, theme : String | Nil = nil, tab_width : Int = 4, colored_output : Bool = true, true_color : Bool = true, header : Bool = false, line_numbers : Bool = true, grid : Bool = true, rule : Bool = true, show_nonprintable : Bool = false, snip : Bool = true, wrapping_mode : Int = 1, use_italics : Bool = true, paging_mode : Int = 1, highlight_line : Int = -1) : Nil","location":{"filename":"src/wombat.cr","line_number":13,"url":"https://github.com/kojix2/wombat/blob/4ed3701692801226c93b67ad169d4d8a303141aa/src/wombat.cr#L13"},"def":{"name":"pretty_print","args":[{"name":"input","external_name":"input","restriction":"String"},{"name":"language","default_value":"nil","external_name":"language","restriction":"String | ::Nil"},{"name":"theme","default_value":"nil","external_name":"theme","restriction":"String | ::Nil"},{"name":"tab_width","default_value":"4","external_name":"tab_width","restriction":"Int"},{"name":"colored_output","default_value":"true","external_name":"colored_output","restriction":"Bool"},{"name":"true_color","default_value":"true","external_name":"true_color","restriction":"Bool"},{"name":"header","default_value":"false","external_name":"header","restriction":"Bool"},{"name":"line_numbers","default_value":"true","external_name":"line_numbers","restriction":"Bool"},{"name":"grid","default_value":"true","external_name":"grid","restriction":"Bool"},{"name":"rule","default_value":"true","external_name":"rule","restriction":"Bool"},{"name":"show_nonprintable","default_value":"false","external_name":"show_nonprintable","restriction":"Bool"},{"name":"snip","default_value":"true","external_name":"snip","restriction":"Bool"},{"name":"wrapping_mode","default_value":"1","external_name":"wrapping_mode","restriction":"Int"},{"name":"use_italics","default_value":"true","external_name":"use_italics","restriction":"Bool"},{"name":"paging_mode","default_value":"1","external_name":"paging_mode","restriction":"Int"},{"name":"highlight_line","default_value":"-1","external_name":"highlight_line","restriction":"Int"}],"return_type":"Nil","visibility":"Public","body":"result = Wombat::Bat.bat_pretty_print(input, input.size, Wombat::Bat::BatInputType::BatBytes, language, theme, Wombat::Bat::BatPrintOptions.new(tab_width: tab_width, colored_output: colored_output, true_color: true_color, header: header, line_numbers: line_numbers, grid: grid, rule: rule, show_nonprintable: show_nonprintable, snip: snip, wrapping_mode: wrapping_mode, use_italics: use_italics, paging_mode: paging_mode, highlight_line: highlight_line))\nif result != 0\n raise(Error.new(\"Failed to pretty print input\"))\nend\n"}},{"html_id":"pretty_print_file(path:Path|String,language:String|Nil=nil,theme:String|Nil=nil,tab_width:Int=4,colored_output:Bool=true,true_color:Bool=true,header:Bool=true,line_numbers:Bool=true,grid:Bool=true,rule:Bool=true,show_nonprintable:Bool=false,snip:Bool=true,wrapping_mode:Int=1,use_italics:Bool=true,paging_mode:Int=1,highlight_line:Int=-1):Nil-class-method","name":"pretty_print_file","doc":"Pretty print the input file","summary":"

Pretty print the input file

","abstract":false,"args":[{"name":"path","external_name":"path","restriction":"Path | String"},{"name":"language","default_value":"nil","external_name":"language","restriction":"String | ::Nil"},{"name":"theme","default_value":"nil","external_name":"theme","restriction":"String | ::Nil"},{"name":"tab_width","default_value":"4","external_name":"tab_width","restriction":"Int"},{"name":"colored_output","default_value":"true","external_name":"colored_output","restriction":"Bool"},{"name":"true_color","default_value":"true","external_name":"true_color","restriction":"Bool"},{"name":"header","default_value":"true","external_name":"header","restriction":"Bool"},{"name":"line_numbers","default_value":"true","external_name":"line_numbers","restriction":"Bool"},{"name":"grid","default_value":"true","external_name":"grid","restriction":"Bool"},{"name":"rule","default_value":"true","external_name":"rule","restriction":"Bool"},{"name":"show_nonprintable","default_value":"false","external_name":"show_nonprintable","restriction":"Bool"},{"name":"snip","default_value":"true","external_name":"snip","restriction":"Bool"},{"name":"wrapping_mode","default_value":"1","external_name":"wrapping_mode","restriction":"Int"},{"name":"use_italics","default_value":"true","external_name":"use_italics","restriction":"Bool"},{"name":"paging_mode","default_value":"1","external_name":"paging_mode","restriction":"Int"},{"name":"highlight_line","default_value":"-1","external_name":"highlight_line","restriction":"Int"}],"args_string":"(path : Path | String, language : String | Nil = nil, theme : String | Nil = nil, tab_width : Int = 4, colored_output : Bool = true, true_color : Bool = true, header : Bool = true, line_numbers : Bool = true, grid : Bool = true, rule : Bool = true, show_nonprintable : Bool = false, snip : Bool = true, wrapping_mode : Int = 1, use_italics : Bool = true, paging_mode : Int = 1, highlight_line : Int = -1) : Nil","args_html":"(path : Path | String, language : String | Nil = nil, theme : String | Nil = nil, tab_width : Int = 4, colored_output : Bool = true, true_color : Bool = true, header : Bool = true, line_numbers : Bool = true, grid : Bool = true, rule : Bool = true, show_nonprintable : Bool = false, snip : Bool = true, wrapping_mode : Int = 1, use_italics : Bool = true, paging_mode : Int = 1, highlight_line : Int = -1) : Nil","location":{"filename":"src/wombat.cr","line_number":59,"url":"https://github.com/kojix2/wombat/blob/4ed3701692801226c93b67ad169d4d8a303141aa/src/wombat.cr#L59"},"def":{"name":"pretty_print_file","args":[{"name":"path","external_name":"path","restriction":"Path | String"},{"name":"language","default_value":"nil","external_name":"language","restriction":"String | ::Nil"},{"name":"theme","default_value":"nil","external_name":"theme","restriction":"String | ::Nil"},{"name":"tab_width","default_value":"4","external_name":"tab_width","restriction":"Int"},{"name":"colored_output","default_value":"true","external_name":"colored_output","restriction":"Bool"},{"name":"true_color","default_value":"true","external_name":"true_color","restriction":"Bool"},{"name":"header","default_value":"true","external_name":"header","restriction":"Bool"},{"name":"line_numbers","default_value":"true","external_name":"line_numbers","restriction":"Bool"},{"name":"grid","default_value":"true","external_name":"grid","restriction":"Bool"},{"name":"rule","default_value":"true","external_name":"rule","restriction":"Bool"},{"name":"show_nonprintable","default_value":"false","external_name":"show_nonprintable","restriction":"Bool"},{"name":"snip","default_value":"true","external_name":"snip","restriction":"Bool"},{"name":"wrapping_mode","default_value":"1","external_name":"wrapping_mode","restriction":"Int"},{"name":"use_italics","default_value":"true","external_name":"use_italics","restriction":"Bool"},{"name":"paging_mode","default_value":"1","external_name":"paging_mode","restriction":"Int"},{"name":"highlight_line","default_value":"-1","external_name":"highlight_line","restriction":"Int"}],"return_type":"Nil","visibility":"Public","body":"result = Wombat::Bat.bat_pretty_print(path.to_s, path.to_s.size, Wombat::Bat::BatInputType::BatFile, language, theme, Wombat::Bat::BatPrintOptions.new(tab_width: tab_width, colored_output: colored_output, true_color: true_color, header: header, line_numbers: line_numbers, grid: grid, rule: rule, show_nonprintable: show_nonprintable, snip: snip, wrapping_mode: wrapping_mode, use_italics: use_italics, paging_mode: paging_mode, highlight_line: highlight_line))\nif result != 0\n raise(Error.new(\"Failed to pretty print file : #{path}\"))\nend\n"}},{"html_id":"pretty_string(input:String,language:String|Nil=nil,theme:String|Nil=nil,tab_width:Int=4,colored_output:Bool=true,true_color:Bool=true,header:Bool=false,line_numbers:Bool=true,grid:Bool=true,rule:Bool=true,show_nonprintable:Bool=false,snip:Bool=true,wrapping_mode:Int=1,use_italics:Bool=true,paging_mode:Int=2,highlight_line:Int=-1):String-class-method","name":"pretty_string","doc":"Get the highlighted string of the input","summary":"

Get the highlighted string of the input

","abstract":false,"args":[{"name":"input","external_name":"input","restriction":"String"},{"name":"language","default_value":"nil","external_name":"language","restriction":"String | ::Nil"},{"name":"theme","default_value":"nil","external_name":"theme","restriction":"String | ::Nil"},{"name":"tab_width","default_value":"4","external_name":"tab_width","restriction":"Int"},{"name":"colored_output","default_value":"true","external_name":"colored_output","restriction":"Bool"},{"name":"true_color","default_value":"true","external_name":"true_color","restriction":"Bool"},{"name":"header","default_value":"false","external_name":"header","restriction":"Bool"},{"name":"line_numbers","default_value":"true","external_name":"line_numbers","restriction":"Bool"},{"name":"grid","default_value":"true","external_name":"grid","restriction":"Bool"},{"name":"rule","default_value":"true","external_name":"rule","restriction":"Bool"},{"name":"show_nonprintable","default_value":"false","external_name":"show_nonprintable","restriction":"Bool"},{"name":"snip","default_value":"true","external_name":"snip","restriction":"Bool"},{"name":"wrapping_mode","default_value":"1","external_name":"wrapping_mode","restriction":"Int"},{"name":"use_italics","default_value":"true","external_name":"use_italics","restriction":"Bool"},{"name":"paging_mode","default_value":"2","external_name":"paging_mode","restriction":"Int"},{"name":"highlight_line","default_value":"-1","external_name":"highlight_line","restriction":"Int"}],"args_string":"(input : String, language : String | Nil = nil, theme : String | Nil = nil, tab_width : Int = 4, colored_output : Bool = true, true_color : Bool = true, header : Bool = false, line_numbers : Bool = true, grid : Bool = true, rule : Bool = true, show_nonprintable : Bool = false, snip : Bool = true, wrapping_mode : Int = 1, use_italics : Bool = true, paging_mode : Int = 2, highlight_line : Int = -1) : String","args_html":"(input : String, language : String | Nil = nil, theme : String | Nil = nil, tab_width : Int = 4, colored_output : Bool = true, true_color : Bool = true, header : Bool = false, line_numbers : Bool = true, grid : Bool = true, rule : Bool = true, show_nonprintable : Bool = false, snip : Bool = true, wrapping_mode : Int = 1, use_italics : Bool = true, paging_mode : Int = 2, highlight_line : Int = -1) : String","location":{"filename":"src/wombat.cr","line_number":105,"url":"https://github.com/kojix2/wombat/blob/4ed3701692801226c93b67ad169d4d8a303141aa/src/wombat.cr#L105"},"def":{"name":"pretty_string","args":[{"name":"input","external_name":"input","restriction":"String"},{"name":"language","default_value":"nil","external_name":"language","restriction":"String | ::Nil"},{"name":"theme","default_value":"nil","external_name":"theme","restriction":"String | ::Nil"},{"name":"tab_width","default_value":"4","external_name":"tab_width","restriction":"Int"},{"name":"colored_output","default_value":"true","external_name":"colored_output","restriction":"Bool"},{"name":"true_color","default_value":"true","external_name":"true_color","restriction":"Bool"},{"name":"header","default_value":"false","external_name":"header","restriction":"Bool"},{"name":"line_numbers","default_value":"true","external_name":"line_numbers","restriction":"Bool"},{"name":"grid","default_value":"true","external_name":"grid","restriction":"Bool"},{"name":"rule","default_value":"true","external_name":"rule","restriction":"Bool"},{"name":"show_nonprintable","default_value":"false","external_name":"show_nonprintable","restriction":"Bool"},{"name":"snip","default_value":"true","external_name":"snip","restriction":"Bool"},{"name":"wrapping_mode","default_value":"1","external_name":"wrapping_mode","restriction":"Int"},{"name":"use_italics","default_value":"true","external_name":"use_italics","restriction":"Bool"},{"name":"paging_mode","default_value":"2","external_name":"paging_mode","restriction":"Int"},{"name":"highlight_line","default_value":"-1","external_name":"highlight_line","restriction":"Int"}],"return_type":"String","visibility":"Public","body":"len_ptr = Pointer(LibC::SizeT).malloc\noutput_ptr = Pointer(Pointer(UInt8)).malloc\nresult = Wombat::Bat.bat_pretty_print_to_string(input, input.size, Wombat::Bat::BatInputType::BatBytes, language, theme, Wombat::Bat::BatPrintOptions.new(tab_width: tab_width, colored_output: colored_output, true_color: true_color, header: header, line_numbers: line_numbers, grid: grid, rule: rule, show_nonprintable: show_nonprintable, snip: snip, wrapping_mode: wrapping_mode, use_italics: use_italics, paging_mode: paging_mode, highlight_line: highlight_line), output_ptr, len_ptr)\nif result != 0\n raise(Error.new(\"Failed to highlight input\"))\nend\nstr = String.new(output_ptr.value, len_ptr.value)\nWombat::Bat.bat_free_string(output_ptr.value)\nstr\n"}}],"types":[{"html_id":"wombat/Wombat/Error","path":"Wombat/Error.html","kind":"class","full_name":"Wombat::Error","name":"Error","abstract":false,"superclass":{"html_id":"wombat/Exception","kind":"class","full_name":"Exception","name":"Exception"},"ancestors":[{"html_id":"wombat/Exception","kind":"class","full_name":"Exception","name":"Exception"},{"html_id":"wombat/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"wombat/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/wombat.cr","line_number":5,"url":"https://github.com/kojix2/wombat/blob/4ed3701692801226c93b67ad169d4d8a303141aa/src/wombat.cr#L5"}],"repository_name":"wombat","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"wombat/Wombat","kind":"module","full_name":"Wombat","name":"Wombat"}}]}]}}) \ No newline at end of file +crystal_doc_search_index_callback({"repository_name":"wombat","body":"# Wombat\n\n\n\nWombat is a Crystal binding for the well-known [bat](https://github.com/sharkdp/bat) syntax highlighting library. `bat` is a `cat(1)` clone with wings, popular among developers for its syntax highlighting capabilities. With Wombat, you can utilize `bat`'s syntax highlighting functionality directly within your Crystal applications.\n\n## About `bat`\n\n- [bat](https://github.com/sharkdp/bat): A well-known `cat(1)` clone with syntax highlighting capabilities.\n- [bat-c](https://github.com/kojix2/bat-c): A C wrapper for the `bat` library.\n\n## Installation\n\n1. **Add the dependency to your `shard.yml`:**\n\n ```yaml\n dependencies:\n wombat:\n github: kojix2/wombat\n ```\n\n2. **Install the dependencies:**\n\n ```sh\n shards install\n ```\n\nDuring installation, a `postinstall` script will automatically download the static library for `bat-c` into the `src/ext` directory.\n\n## Usage\n\n### Obtain a Syntax Highlighted String\n\nRetrieve and output a syntax highlighted string:\n\n```crystal\nrequire \"wombat\"\n\nhighlighted = Wombat.pretty_string(%{puts \"hello world\"})\nputs highlighted\n```\n\n### Output a Syntax Highlighted File\n\nOutput the contents of a file with syntax highlighting. `bat` will automatically invoke `less`:\n\n```crystal\nrequire \"wombat\"\n\nWombat.pretty_print_file(\"/path/to/your_file.cr\")\n```\n\nFor more details, refer to the [API Documentation](https://kojix2.github.io/wombat/).\n\n## Development\n\nSustainable development is important. If you encounter any issues or have suggestions for improvement, please contribute!\n\n## Contributing\n\nYour contributions are always welcome! Feel free to raise issues, submit pull requests, or suggest new features.\n","program":{"html_id":"wombat/toplevel","path":"toplevel.html","kind":"module","full_name":"Top Level Namespace","name":"Top Level Namespace","abstract":false,"locations":[],"repository_name":"wombat","program":true,"enum":false,"alias":false,"const":false,"types":[{"html_id":"wombat/Wombat","path":"Wombat.html","kind":"module","full_name":"Wombat","name":"Wombat","abstract":false,"locations":[{"filename":"src/wombat.cr","line_number":4,"url":"https://github.com/kojix2/wombat/blob/7736805604c58c44d1ba2070a1e071f49de33d2f/src/wombat.cr#L4"},{"filename":"src/wombat/lib_bat.cr","line_number":1,"url":"https://github.com/kojix2/wombat/blob/7736805604c58c44d1ba2070a1e071f49de33d2f/src/wombat/lib_bat.cr#L1"},{"filename":"src/wombat/version.cr","line_number":1,"url":"https://github.com/kojix2/wombat/blob/7736805604c58c44d1ba2070a1e071f49de33d2f/src/wombat/version.cr#L1"}],"repository_name":"wombat","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"VERSION","name":"VERSION","value":"{{ (`shards version /home/runner/work/wombat/wombat/src/wombat`).chomp.stringify }}"}],"class_methods":[{"html_id":"bat_c_version:String-class-method","name":"bat_c_version","doc":"Returns the version of the bat_c","summary":"

Returns the version of the bat_c

","abstract":false,"location":{"filename":"src/wombat.cr","line_number":8,"url":"https://github.com/kojix2/wombat/blob/7736805604c58c44d1ba2070a1e071f49de33d2f/src/wombat.cr#L8"},"def":{"name":"bat_c_version","return_type":"String","visibility":"Public","body":"String.new(Wombat::Bat.bat_c_version)"}},{"html_id":"pretty_print(input:String,language:String|Nil=nil,theme:String|Nil=nil,tab_width:Int=4,colored_output:Bool=true,true_color:Bool=true,header:Bool=false,line_numbers:Bool=true,grid:Bool=true,rule:Bool=true,show_nonprintable:Bool=false,snip:Bool=true,wrapping_mode:Int=1,use_italics:Bool=true,paging_mode:Int=1,highlight_line:Int=-1):Nil-class-method","name":"pretty_print","doc":"Pretty print the input string","summary":"

Pretty print the input string

","abstract":false,"args":[{"name":"input","external_name":"input","restriction":"String"},{"name":"language","default_value":"nil","external_name":"language","restriction":"String | ::Nil"},{"name":"theme","default_value":"nil","external_name":"theme","restriction":"String | ::Nil"},{"name":"tab_width","default_value":"4","external_name":"tab_width","restriction":"Int"},{"name":"colored_output","default_value":"true","external_name":"colored_output","restriction":"Bool"},{"name":"true_color","default_value":"true","external_name":"true_color","restriction":"Bool"},{"name":"header","default_value":"false","external_name":"header","restriction":"Bool"},{"name":"line_numbers","default_value":"true","external_name":"line_numbers","restriction":"Bool"},{"name":"grid","default_value":"true","external_name":"grid","restriction":"Bool"},{"name":"rule","default_value":"true","external_name":"rule","restriction":"Bool"},{"name":"show_nonprintable","default_value":"false","external_name":"show_nonprintable","restriction":"Bool"},{"name":"snip","default_value":"true","external_name":"snip","restriction":"Bool"},{"name":"wrapping_mode","default_value":"1","external_name":"wrapping_mode","restriction":"Int"},{"name":"use_italics","default_value":"true","external_name":"use_italics","restriction":"Bool"},{"name":"paging_mode","default_value":"1","external_name":"paging_mode","restriction":"Int"},{"name":"highlight_line","default_value":"-1","external_name":"highlight_line","restriction":"Int"}],"args_string":"(input : String, language : String | Nil = nil, theme : String | Nil = nil, tab_width : Int = 4, colored_output : Bool = true, true_color : Bool = true, header : Bool = false, line_numbers : Bool = true, grid : Bool = true, rule : Bool = true, show_nonprintable : Bool = false, snip : Bool = true, wrapping_mode : Int = 1, use_italics : Bool = true, paging_mode : Int = 1, highlight_line : Int = -1) : Nil","args_html":"(input : String, language : String | Nil = nil, theme : String | Nil = nil, tab_width : Int = 4, colored_output : Bool = true, true_color : Bool = true, header : Bool = false, line_numbers : Bool = true, grid : Bool = true, rule : Bool = true, show_nonprintable : Bool = false, snip : Bool = true, wrapping_mode : Int = 1, use_italics : Bool = true, paging_mode : Int = 1, highlight_line : Int = -1) : Nil","location":{"filename":"src/wombat.cr","line_number":13,"url":"https://github.com/kojix2/wombat/blob/7736805604c58c44d1ba2070a1e071f49de33d2f/src/wombat.cr#L13"},"def":{"name":"pretty_print","args":[{"name":"input","external_name":"input","restriction":"String"},{"name":"language","default_value":"nil","external_name":"language","restriction":"String | ::Nil"},{"name":"theme","default_value":"nil","external_name":"theme","restriction":"String | ::Nil"},{"name":"tab_width","default_value":"4","external_name":"tab_width","restriction":"Int"},{"name":"colored_output","default_value":"true","external_name":"colored_output","restriction":"Bool"},{"name":"true_color","default_value":"true","external_name":"true_color","restriction":"Bool"},{"name":"header","default_value":"false","external_name":"header","restriction":"Bool"},{"name":"line_numbers","default_value":"true","external_name":"line_numbers","restriction":"Bool"},{"name":"grid","default_value":"true","external_name":"grid","restriction":"Bool"},{"name":"rule","default_value":"true","external_name":"rule","restriction":"Bool"},{"name":"show_nonprintable","default_value":"false","external_name":"show_nonprintable","restriction":"Bool"},{"name":"snip","default_value":"true","external_name":"snip","restriction":"Bool"},{"name":"wrapping_mode","default_value":"1","external_name":"wrapping_mode","restriction":"Int"},{"name":"use_italics","default_value":"true","external_name":"use_italics","restriction":"Bool"},{"name":"paging_mode","default_value":"1","external_name":"paging_mode","restriction":"Int"},{"name":"highlight_line","default_value":"-1","external_name":"highlight_line","restriction":"Int"}],"return_type":"Nil","visibility":"Public","body":"result = Wombat::Bat.bat_pretty_print(input, input.size, Wombat::Bat::BatInputType::BatBytes, language, theme, Wombat::Bat::BatPrintOptions.new(tab_width: tab_width, colored_output: colored_output, true_color: true_color, header: header, line_numbers: line_numbers, grid: grid, rule: rule, show_nonprintable: show_nonprintable, snip: snip, wrapping_mode: wrapping_mode, use_italics: use_italics, paging_mode: paging_mode, highlight_line: highlight_line))\nif result != 0\n raise(Error.new(\"Failed to pretty print input\"))\nend\n"}},{"html_id":"pretty_print_file(path:Path|String,language:String|Nil=nil,theme:String|Nil=nil,tab_width:Int=4,colored_output:Bool=true,true_color:Bool=true,header:Bool=true,line_numbers:Bool=true,grid:Bool=true,rule:Bool=true,show_nonprintable:Bool=false,snip:Bool=true,wrapping_mode:Int=1,use_italics:Bool=true,paging_mode:Int=1,highlight_line:Int=-1):Nil-class-method","name":"pretty_print_file","doc":"Pretty print the input file","summary":"

Pretty print the input file

","abstract":false,"args":[{"name":"path","external_name":"path","restriction":"Path | String"},{"name":"language","default_value":"nil","external_name":"language","restriction":"String | ::Nil"},{"name":"theme","default_value":"nil","external_name":"theme","restriction":"String | ::Nil"},{"name":"tab_width","default_value":"4","external_name":"tab_width","restriction":"Int"},{"name":"colored_output","default_value":"true","external_name":"colored_output","restriction":"Bool"},{"name":"true_color","default_value":"true","external_name":"true_color","restriction":"Bool"},{"name":"header","default_value":"true","external_name":"header","restriction":"Bool"},{"name":"line_numbers","default_value":"true","external_name":"line_numbers","restriction":"Bool"},{"name":"grid","default_value":"true","external_name":"grid","restriction":"Bool"},{"name":"rule","default_value":"true","external_name":"rule","restriction":"Bool"},{"name":"show_nonprintable","default_value":"false","external_name":"show_nonprintable","restriction":"Bool"},{"name":"snip","default_value":"true","external_name":"snip","restriction":"Bool"},{"name":"wrapping_mode","default_value":"1","external_name":"wrapping_mode","restriction":"Int"},{"name":"use_italics","default_value":"true","external_name":"use_italics","restriction":"Bool"},{"name":"paging_mode","default_value":"1","external_name":"paging_mode","restriction":"Int"},{"name":"highlight_line","default_value":"-1","external_name":"highlight_line","restriction":"Int"}],"args_string":"(path : Path | String, language : String | Nil = nil, theme : String | Nil = nil, tab_width : Int = 4, colored_output : Bool = true, true_color : Bool = true, header : Bool = true, line_numbers : Bool = true, grid : Bool = true, rule : Bool = true, show_nonprintable : Bool = false, snip : Bool = true, wrapping_mode : Int = 1, use_italics : Bool = true, paging_mode : Int = 1, highlight_line : Int = -1) : Nil","args_html":"(path : Path | String, language : String | Nil = nil, theme : String | Nil = nil, tab_width : Int = 4, colored_output : Bool = true, true_color : Bool = true, header : Bool = true, line_numbers : Bool = true, grid : Bool = true, rule : Bool = true, show_nonprintable : Bool = false, snip : Bool = true, wrapping_mode : Int = 1, use_italics : Bool = true, paging_mode : Int = 1, highlight_line : Int = -1) : Nil","location":{"filename":"src/wombat.cr","line_number":59,"url":"https://github.com/kojix2/wombat/blob/7736805604c58c44d1ba2070a1e071f49de33d2f/src/wombat.cr#L59"},"def":{"name":"pretty_print_file","args":[{"name":"path","external_name":"path","restriction":"Path | String"},{"name":"language","default_value":"nil","external_name":"language","restriction":"String | ::Nil"},{"name":"theme","default_value":"nil","external_name":"theme","restriction":"String | ::Nil"},{"name":"tab_width","default_value":"4","external_name":"tab_width","restriction":"Int"},{"name":"colored_output","default_value":"true","external_name":"colored_output","restriction":"Bool"},{"name":"true_color","default_value":"true","external_name":"true_color","restriction":"Bool"},{"name":"header","default_value":"true","external_name":"header","restriction":"Bool"},{"name":"line_numbers","default_value":"true","external_name":"line_numbers","restriction":"Bool"},{"name":"grid","default_value":"true","external_name":"grid","restriction":"Bool"},{"name":"rule","default_value":"true","external_name":"rule","restriction":"Bool"},{"name":"show_nonprintable","default_value":"false","external_name":"show_nonprintable","restriction":"Bool"},{"name":"snip","default_value":"true","external_name":"snip","restriction":"Bool"},{"name":"wrapping_mode","default_value":"1","external_name":"wrapping_mode","restriction":"Int"},{"name":"use_italics","default_value":"true","external_name":"use_italics","restriction":"Bool"},{"name":"paging_mode","default_value":"1","external_name":"paging_mode","restriction":"Int"},{"name":"highlight_line","default_value":"-1","external_name":"highlight_line","restriction":"Int"}],"return_type":"Nil","visibility":"Public","body":"result = Wombat::Bat.bat_pretty_print(path.to_s, path.to_s.size, Wombat::Bat::BatInputType::BatFile, language, theme, Wombat::Bat::BatPrintOptions.new(tab_width: tab_width, colored_output: colored_output, true_color: true_color, header: header, line_numbers: line_numbers, grid: grid, rule: rule, show_nonprintable: show_nonprintable, snip: snip, wrapping_mode: wrapping_mode, use_italics: use_italics, paging_mode: paging_mode, highlight_line: highlight_line))\nif result != 0\n raise(Error.new(\"Failed to pretty print file : #{path}\"))\nend\n"}},{"html_id":"pretty_string(input:String,language:String|Nil=nil,theme:String|Nil=nil,tab_width:Int=4,colored_output:Bool=true,true_color:Bool=true,header:Bool=false,line_numbers:Bool=true,grid:Bool=true,rule:Bool=true,show_nonprintable:Bool=false,snip:Bool=true,wrapping_mode:Int=1,use_italics:Bool=true,paging_mode:Int=2,highlight_line:Int=-1):String-class-method","name":"pretty_string","doc":"Get the highlighted string of the input","summary":"

Get the highlighted string of the input

","abstract":false,"args":[{"name":"input","external_name":"input","restriction":"String"},{"name":"language","default_value":"nil","external_name":"language","restriction":"String | ::Nil"},{"name":"theme","default_value":"nil","external_name":"theme","restriction":"String | ::Nil"},{"name":"tab_width","default_value":"4","external_name":"tab_width","restriction":"Int"},{"name":"colored_output","default_value":"true","external_name":"colored_output","restriction":"Bool"},{"name":"true_color","default_value":"true","external_name":"true_color","restriction":"Bool"},{"name":"header","default_value":"false","external_name":"header","restriction":"Bool"},{"name":"line_numbers","default_value":"true","external_name":"line_numbers","restriction":"Bool"},{"name":"grid","default_value":"true","external_name":"grid","restriction":"Bool"},{"name":"rule","default_value":"true","external_name":"rule","restriction":"Bool"},{"name":"show_nonprintable","default_value":"false","external_name":"show_nonprintable","restriction":"Bool"},{"name":"snip","default_value":"true","external_name":"snip","restriction":"Bool"},{"name":"wrapping_mode","default_value":"1","external_name":"wrapping_mode","restriction":"Int"},{"name":"use_italics","default_value":"true","external_name":"use_italics","restriction":"Bool"},{"name":"paging_mode","default_value":"2","external_name":"paging_mode","restriction":"Int"},{"name":"highlight_line","default_value":"-1","external_name":"highlight_line","restriction":"Int"}],"args_string":"(input : String, language : String | Nil = nil, theme : String | Nil = nil, tab_width : Int = 4, colored_output : Bool = true, true_color : Bool = true, header : Bool = false, line_numbers : Bool = true, grid : Bool = true, rule : Bool = true, show_nonprintable : Bool = false, snip : Bool = true, wrapping_mode : Int = 1, use_italics : Bool = true, paging_mode : Int = 2, highlight_line : Int = -1) : String","args_html":"(input : String, language : String | Nil = nil, theme : String | Nil = nil, tab_width : Int = 4, colored_output : Bool = true, true_color : Bool = true, header : Bool = false, line_numbers : Bool = true, grid : Bool = true, rule : Bool = true, show_nonprintable : Bool = false, snip : Bool = true, wrapping_mode : Int = 1, use_italics : Bool = true, paging_mode : Int = 2, highlight_line : Int = -1) : String","location":{"filename":"src/wombat.cr","line_number":105,"url":"https://github.com/kojix2/wombat/blob/7736805604c58c44d1ba2070a1e071f49de33d2f/src/wombat.cr#L105"},"def":{"name":"pretty_string","args":[{"name":"input","external_name":"input","restriction":"String"},{"name":"language","default_value":"nil","external_name":"language","restriction":"String | ::Nil"},{"name":"theme","default_value":"nil","external_name":"theme","restriction":"String | ::Nil"},{"name":"tab_width","default_value":"4","external_name":"tab_width","restriction":"Int"},{"name":"colored_output","default_value":"true","external_name":"colored_output","restriction":"Bool"},{"name":"true_color","default_value":"true","external_name":"true_color","restriction":"Bool"},{"name":"header","default_value":"false","external_name":"header","restriction":"Bool"},{"name":"line_numbers","default_value":"true","external_name":"line_numbers","restriction":"Bool"},{"name":"grid","default_value":"true","external_name":"grid","restriction":"Bool"},{"name":"rule","default_value":"true","external_name":"rule","restriction":"Bool"},{"name":"show_nonprintable","default_value":"false","external_name":"show_nonprintable","restriction":"Bool"},{"name":"snip","default_value":"true","external_name":"snip","restriction":"Bool"},{"name":"wrapping_mode","default_value":"1","external_name":"wrapping_mode","restriction":"Int"},{"name":"use_italics","default_value":"true","external_name":"use_italics","restriction":"Bool"},{"name":"paging_mode","default_value":"2","external_name":"paging_mode","restriction":"Int"},{"name":"highlight_line","default_value":"-1","external_name":"highlight_line","restriction":"Int"}],"return_type":"String","visibility":"Public","body":"len_ptr = Pointer(LibC::SizeT).malloc\noutput_ptr = Pointer(Pointer(UInt8)).malloc\nresult = Wombat::Bat.bat_pretty_print_to_string(input, input.size, Wombat::Bat::BatInputType::BatBytes, language, theme, Wombat::Bat::BatPrintOptions.new(tab_width: tab_width, colored_output: colored_output, true_color: true_color, header: header, line_numbers: line_numbers, grid: grid, rule: rule, show_nonprintable: show_nonprintable, snip: snip, wrapping_mode: wrapping_mode, use_italics: use_italics, paging_mode: paging_mode, highlight_line: highlight_line), output_ptr, len_ptr)\nif result != 0\n raise(Error.new(\"Failed to highlight input\"))\nend\nstr = String.new(output_ptr.value, len_ptr.value)\nWombat::Bat.bat_free_string(output_ptr.value)\nstr\n"}}],"types":[{"html_id":"wombat/Wombat/Error","path":"Wombat/Error.html","kind":"class","full_name":"Wombat::Error","name":"Error","abstract":false,"superclass":{"html_id":"wombat/Exception","kind":"class","full_name":"Exception","name":"Exception"},"ancestors":[{"html_id":"wombat/Exception","kind":"class","full_name":"Exception","name":"Exception"},{"html_id":"wombat/Reference","kind":"class","full_name":"Reference","name":"Reference"},{"html_id":"wombat/Object","kind":"class","full_name":"Object","name":"Object"}],"locations":[{"filename":"src/wombat.cr","line_number":5,"url":"https://github.com/kojix2/wombat/blob/7736805604c58c44d1ba2070a1e071f49de33d2f/src/wombat.cr#L5"}],"repository_name":"wombat","program":false,"enum":false,"alias":false,"const":false,"namespace":{"html_id":"wombat/Wombat","kind":"module","full_name":"Wombat","name":"Wombat"}}]}]}}) \ No newline at end of file