Gawe MD ing Go SDK

Kanggo nggawe MD saka ngeruk programmatically nggunakake perpustakaan Go kuat kita

Kanthi solusi iki, Go pangembang bisa gampang nggawe MD mung nganggo sawetara baris kode. Solusi kita bakal menehi sampeyan kabeh sing dibutuhake kanggo nggawe MD nggunakake Go SDK.

Ndeleng potongan kode

Nggawe MD dokumen nggunakake Go

Kanthi REST API, pangembang Go bisa nggawe MD dokumen kanthi gampang. Kanggo nindakake iki, sampeyan kudu nindakake sawetara langkah nggunakake Go SDK kita:

  1. Setel jeneng file
  2. Telpon cara 'CreateDocument' kanggo nggawe MD dokumen ing Go
  3. Simpen MD file output

Wiwit MD dokumen kosong mesthine ngemot siji paragraf, nalika sampeyan nggawe MD file kanthi program, sampeyan bakal entuk struktur dhasar kasebut.

Elinga yen sampeyan bisa nambah konten menyang MD dokumen sing mentas digawe. Mangkono, sampeyan bakal entuk ora mung file kosong, nanging MD dokumen sing ngemot konten sing dibutuhake. Kanggo informasi luwih lengkap babagan carane ngowahi MD dokumen, deleng kaca 'Edit MD'.

Nggawe MD file ing Go

Kaya sing wis kasebut, Go SDK kita ngidini sampeyan nggawe MD dokumen kanthi program. Sampeyan bisa nyoba fungsi sing kuat lan ngevaluasi carane nggawe MD dokumen nggunakake conto Go ing ngisor iki:

Pilih format target saka dhaptar
Kode roto
import (
    "os"
    "github.com/aspose-words-cloud/aspose-words-cloud-go/dev/api/models"
)

config, _ := models.NewConfiguration("config.json")
wordsApi, ctx, _ := api.CreateWordsApi(config)
fileName:= "Output.md"

createDocumentRequestOptions := map[string]interface{}{"fileName": fileName,}
createDocumentRequest := &models.CreateDocumentRequest{
    Optionals: createDocumentRequestOptions,
}
_, _, _ = wordsApi.CreateDocument(ctx, createDocumentRequest)

downloadDocumentRequestOptions := map[string]interface{}{}
downloadDocumentRequest := &models.DownloadFileRequest{
    Path: ToStringPointer(fileName),
    Optionals: downloadDocumentRequestOptions,
}
_, _ = wordsApi.DownloadFile(ctx, downloadDocumentRequest)
Kode roto
  
Nyalin kode Go menyang clipboard

Carane nggawe MD

  1. Pasang Aspose.Words Cloud for Go
  2. Tambah referensi perpustakaan (ngimpor perpustakaan) kanggo proyek Go
  3. Konfigurasi API nggunakake tombol app
  4. Setel jeneng MD dokumen anyar
  5. Nggawe panjalukan kanggo nggawe MD, ngliwati jeneng dokumen iki
  6. Nelpon metode CreateDocument(), ngliwati panjaluk kasebut
  7. Entuk asil operasi nggawe MD minangka file sing kapisah

Go perpustakaan kanggo nggunakake MD nggawe

Run go get -v github.com/aspose-words-cloud/aspose-words-cloud-go/2007/api kanggo nginstal Aspose.Words Cloud SDK for Go. Sampeyan bisa entuk akeh informasi migunani babagan cara instalasi liyane saka bagean "How to use SDK".

Klone Aspose.Words Cloud SDK for Go saka GitHub lan gunakake ing proyek sampeyan. Tututi Instructions iki supaya cepet entuk kredensial keamanan sing dibutuhake lan ngakses REST API kita.

Requirements Sistem

Deleng Repository Documentation kanggo ndeleng rincian.

Format file liyane sing didhukung

Sampeyan bisa nggawe dokumen ing 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.