Sunting Markdown ing Swift SDK

Gunakake REST API kanggo nyunting Markdown ing Swift kanthi terprogram

Nalika pangembang ngowahi Markdown dokumen nganggo perpustakaan Swift iki, sing lagi diowahi yaiku Model Obyek Dokumen (DOM). Dadi, meh kabeh owah-owahan bisa ditindakake kanggo Markdown dokumen sing diwakili minangka DOM. Kanthi Swift 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.

Ndeleng potongan kode

Sunting Markdown ing Swift nggunakake REST API

Pustaka Swift 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.

Sunting teks ing Markdown file nggunakake Swift

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 Swift ing dokumen kasebut.

Sunting tabel ing Markdown file nggunakake Swift

Pilihan editing Markdown liyane sing populer yaiku nyunting tabel. Swift SDK kita ngidini sampeyan nggarap tabel lan teks ing sel tabel.

Pangembang Swift bisa nambah utawa mbusak sel tabel lan tabel, uga nambah, ngowahi lan mbusak teks ing njero.

Tambah gambar menyang Markdown file nggunakake Swift

Saliyane nyunting teks lan tabel ing Markdown, ana pilihan umum liyane: nambahake gambar menyang dokumen ing Swift. Pangembang Swift uga bisa nambah gambar menyang Markdown file nggunakake DOM.

Sunting Markdown kanthi terprogram

Coba Swift 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:

Unggah dokumen sing pengin diowahi
Kode roto
Unggah gambar sing pengin dilebokake
Pilih format target saka dhaptar
import AsposeWordsCloud

let config = Configuration(clientId: "####-####-####-####-####", 
   clientSecret: "##################");
let api = try WordsAPI(configuration: config);

let requestDocument = InputStream(url: URL(string: "Input.md"))!;
let requestParagraph = ParagraphInsert()
  .setText(text: "Morbi enim nunc faucibus a.");
let insertParagraphRequest = InsertParagraphOnlineRequest(document: requestDocument, 
   paragraph: requestParagraph);
let insertParagraph = try api.insertParagraphOnline(request: insertParagraphRequest);

let convertRequest = ConvertDocumentRequest(document: insertParagraph.document.values.first,
  format: "md");
let convert = try api.convertDocument(request: convertRequest);
import AsposeWordsCloud

let config = Configuration(clientId: "####-####-####-####-####", 
   clientSecret: "##################");
let api = try WordsAPI(configuration: config);

let requestDocument = InputStream(url: URL(string: "Input.md"))!;
let requestTable = TableInsert()
  .setColumnsCount(columnsCount: 1)
  .setRowsCount(rowsCount: 2);
let insertTableRequest = InsertTableOnlineRequest(document: requestDocument, 
   table: requestTable, nodePath: "");
let insertTable = try api.insertTableOnline(request: insertTableRequest);

let convertRequest = ConvertDocumentRequest(document: insertTable.document.values.first,
  format: "md");
let convert = try api.convertDocument(request: convertRequest);
import AsposeWordsCloud

let config = Configuration(clientId: "####-####-####-####-####", 
   clientSecret: "##################");
let api = try WordsAPI(configuration: config);

let requestDocument = InputStream(url: URL(string: "Input1.md"))!;
let requestDrawingObject = DrawingObjectInsert()
  .setHeight(height: 0)
  .setLeft(_left: 0)
  .setRelativeHorizontalPosition(
     relativeHorizontalPosition: DrawingObjectInsert.RelativeHorizontalPosition.margin)
  .setRelativeVerticalPosition(
     relativeVerticalPosition: DrawingObjectInsert.RelativeVerticalPosition.margin)
  .setTop(top: 0)
  .setWidth(width: 0)
  .setWrapType(wrapType: DrawingObjectInsert.WrapType.inline);

let requestImageFile = InputStream(url: URL(string: "Input2.md"))!;
let insertDrawingObjectRequest = InsertDrawingObjectOnlineRequest(document: requestDocument, 
   drawingObject: requestDrawingObject, imageFile: requestImageFile, nodePath: "sections/0");
let insertDrawingObject = 
   try api.insertDrawingObjectOnline(request: insertDrawingObjectRequest);

let convertRequest = ConvertDocumentRequest(
   document: insertDrawingObject.document.values.first, format: "md");
let convert = try api.convertDocument(request: convertRequest);
Kode roto
  
Nyalin kode Swift menyang clipboard

Cara Ngowahi Markdown ing Swift

  1. Pasang 'Aspose.Words Cloud kanggo Swift'
  2. Tambah referensi perpustakaan (ngimpor perpustakaan) menyang proyek Swift sampeyan
  3. Muat Markdown kanggo nyunting ing Swift
  4. Lebokake isi ing wiwitan Markdown
  5. Download dokumen asil saka panyimpenan maya

Pustaka Swift kanggo nggunakake panyuntingan MD.

Sampeyan bisa nggunakake manajer paket Swift lan manajer dependensi Cocoapods kanggo nginstal Aspose.Words Cloud SDK for Swift. Informasi rinci babagan nginstal paket diwenehi ing bagean "Installation and Usage".

Minangka alternatif, sampeyan bisa clone Aspose.Words Cloud SDK for Swift saka GitHub lan nggunakake ing project.

Tututi Instructions iki supaya cepet entuk kredensial keamanan sing dibutuhake lan ngakses REST API kita.

Requirements Sistem

Swift 4.2 utawa luwih anyar

Deleng Repository Documentation kanggo ndeleng rincian liyane.

Format file liyane sing didhukung

Sampeyan bisa nindakake operasi suntingan kanggo format file liyane:

5%

Langganan kanggo Aspose Update Product

Entuk buletin saben wulan lan tawaran langsung dikirim menyang kothak layang.

© Aspose Pty Ltd 2001-2024. Kabeh hak dilindhungi undhang-undhang.