Nalika pangembang ngowahi Markdown dokumen nganggo perpustakaan Ruby iki, sing lagi diowahi yaiku Model Obyek Dokumen (DOM). Dadi, meh kabeh owah-owahan bisa ditindakake kanggo Markdown dokumen sing diwakili minangka DOM. Kanthi Ruby SDK sing disedhiyakake, pangembang bisa kanthi gampang nyunting dokumen: ngowahi teks, nganyari tabel, nambah gambar lan liya-liyane. Cukup mbukak Markdown, gawe owah-owahan sing dibutuhake kanthi program lan ekspor asil menyang format nyimpen sing padha utawa sing didhukung.
Pustaka Ruby kita menehi pangembang kemampuan kanggo ngowahi Markdown dokumen kanthi langsung kanthi nyunting Document Object Model (DOM), tegese ora ana piranti lunak tambahan sing kudu diinstal.
Kasus sing paling populer kanggo nyunting Markdown file yaiku nyunting teks. Kanthi solusi piranti lunak sing diwenehake, sampeyan bisa nambah, ngowahi utawa mbusak teks nggunakake Ruby ing dokumen kasebut.
Pilihan editing Markdown liyane sing populer yaiku nyunting tabel. Ruby SDK kita ngidini sampeyan nggarap tabel lan teks ing sel tabel.
Pangembang Ruby bisa nambah utawa mbusak sel tabel lan tabel, uga nambah, ngowahi lan mbusak teks ing njero.
Saliyane nyunting teks lan tabel ing Markdown, ana pilihan umum liyane: nambahake gambar menyang dokumen ing Ruby. Pangembang Ruby uga bisa nambah gambar menyang Markdown file nggunakake DOM.
Coba Ruby SDK sing kuat iki lan evaluasi sawetara opsi ing panyuntingan Markdown dokumen. Nggunakake conto ing ngisor iki, muat Markdown dokumen lan gawe sawetara owah-owahan: nambah teks, nambah tabel lan sel tabel kanthi teks utawa lebokake gambar menyang Markdown dokumen:
require 'aspose_words_cloud'
AsposeWordsCloud.configure do |config|
config.client_data['ClientId'] = '####-####-####-####-####'
config.client_data['ClientSecret'] = '##################'
end
@words_api = WordsAPI.new
request_document = File.open('Input.md')
request_paragraph = ParagraphInsert.new({:Text => 'Morbi enim nunc faucibus a.'})
insert_paragraph_request = InsertParagraphOnlineRequest.new(document: request_document,
paragraph: request_paragraph)
insert_paragraph = @words_api.insert_paragraph_online(insert_paragraph_request)
convert_request = ConvertDocumentRequest.new(
document: insert_paragraph.document.values[0], format: 'md')
convert = @words_api.convert_document(convert_request)
require 'aspose_words_cloud'
AsposeWordsCloud.configure do |config|
config.client_data['ClientId'] = '####-####-####-####-####'
config.client_data['ClientSecret'] = '##################'
end
@words_api = WordsAPI.new
request_document = File.open('Input.md')
request_table = TableInsert.new({:ColumnsCount => 1, :RowsCount => 2})
insert_table_request = InsertTableOnlineRequest.new(document: request_document,
table: request_table, node_path: '')
insert_table = @words_api.insert_table_online(insert_table_request)
convert_request = ConvertDocumentRequest.new(
document: insert_table.document.values[0], format: 'md')
convert = @words_api.convert_document(convert_request)
require 'aspose_words_cloud'
AsposeWordsCloud.configure do |config|
config.client_data['ClientId'] = '####-####-####-####-####'
config.client_data['ClientSecret'] = '##################'
end
@words_api = WordsAPI.new
request_document = File.open('Input1.md')
request_drawing_object = DrawingObjectInsert.new({:Height => 0, :Left => 0, :Top => 0,
:Width => 0, :RelativeHorizontalPosition => 'Margin',
:RelativeVerticalPosition => 'Margin', :WrapType => 'Inline'})
request_image_file = File.open('Input2.md')
insert_drawing_object_request = InsertDrawingObjectOnlineRequest.new(
document: request_document, drawing_object: request_drawing_object,
image_file: request_image_file, node_path: 'sections/0')
insert_drawing_object = @words_api.insert_drawing_object_online(insert_drawing_object_request)
convert_request = ConvertDocumentRequest.new(
document: insert_drawing_object.document.values[0], format: 'md')
convert = @words_api.convert_document(convert_request)
Instal Aspose.Words Cloud SDK for Ruby nggunakake layanan hosting RubyGems. gem install aspose_words_cloud kanggo nginstal paket kasebut. Minangka alternatif, sampeyan bisa kanthi manual kloning Aspose.Words Cloud SDK for Ruby saka GitHub lan nggunakake ing project. Tututi Instructions iki supaya cepet entuk kredensial keamanan sing dibutuhake lan ngakses REST API kita.
Ruby 2.6 utawa luwih anyar
Deleng Repository Documentation kanggo ndeleng rincian.
Sampeyan bisa nindakake operasi suntingan kanggo format file liyane: