github.com/gnolang/gno@v0.0.0-20240520182011-228e9d0192ce/examples/gno.land/r/demo/boards/z_7_filetest.gno (about)

     1  // PKGPATH: gno.land/r/boards_test
     2  package boards_test
     3  
     4  // SEND: 2000000000ugnot
     5  
     6  import (
     7  	"gno.land/r/demo/boards"
     8  	"gno.land/r/demo/users"
     9  )
    10  
    11  func init() {
    12  	// register
    13  	users.Register("", "gnouser", "my profile")
    14  
    15  	// create board and post
    16  	bid := boards.CreateBoard("test_board")
    17  	boards.CreateThread(bid, "First Post (title)", "Body of the first post. (body)")
    18  }
    19  
    20  func main() {
    21  	println(boards.Render("test_board"))
    22  }
    23  
    24  // Output:
    25  // \[[post](/r/demo/boards?help&__func=CreateThread&bid=1&body.type=textarea)]
    26  //
    27  // ----------------------------------------
    28  // ## [First Post (title)](/r/demo/boards:test_board/1)
    29  //
    30  // Body of the first post. (body)
    31  // \- [@gnouser](/r/demo/users:gnouser), [2009-02-13 11:31pm UTC](/r/demo/boards:test_board/1) \[[x](/r/demo/boards?help&__func=DeletePost&bid=1&threadid=1&postid=1)] (0 replies) (0 reposts)