Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

Commit

Permalink
馃帹 Format comments and code width
Browse files Browse the repository at this point in the history
Use 100 instead 80
  • Loading branch information
toby3d committed Dec 13, 2017
1 parent 3a273cd commit 4cb87b4
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 35 deletions.
3 changes: 2 additions & 1 deletion content.go
Expand Up @@ -78,7 +78,8 @@ func domToNode(domNode *html.Node) interface{} {

var nodeElement NodeElement
switch strings.ToLower(domNode.Data) {
case "a", "aside", "b", "blockquote", "br", "code", "em", "figcaption", "figure", "h3", "h4", "hr", "i", "iframe", "img", "li", "ol", "p", "pre", "s", "strong", "u", "ul", "video":
case "a", "aside", "b", "blockquote", "br", "code", "em", "figcaption", "figure", "h3", "h4",
"hr", "i", "iframe", "img", "li", "ol", "p", "pre", "s", "strong", "u", "ul", "video":
nodeElement.Tag = domNode.Data

for i := range domNode.Attr {
Expand Down
11 changes: 5 additions & 6 deletions create_account.go
Expand Up @@ -38,17 +38,16 @@ type Account struct {
func CreateAccount(account *Account) (*Account, error) {
args := http.AcquireArgs()

// Account name, helps users with several accounts remember which they are
// currently using. Displayed to the user above the "Edit/Publish" button
// on Telegra.ph, other users don't see this name.
// Account name, helps users with several accounts remember which they are currently using.
// Displayed to the user above the "Edit/Publish" button on Telegra.ph, other users don't see
// this name.
args.Add("short_name", account.ShortName) // required

// Default author name used when creating new articles.
args.Add("author_name", account.AuthorName)

// Default profile link, opened when users click on the author's name
// below the title. Can be any link, not necessarily to a Telegram profile
// or channel.
// Default profile link, opened when users click on the author's name below the title. Can be any
// link, not necessarily to a Telegram profile or channel.
args.Add("author_url", account.AuthorURL)

body, err := request("createAccount", "", args)
Expand Down
5 changes: 2 additions & 3 deletions create_page.go
Expand Up @@ -57,9 +57,8 @@ func (account *Account) CreatePage(page *Page, returnContent bool) (*Page, error
}

if page.AuthorURL != "" {
// Profile link, opened when users click on the author's name below
// the title. Can be any link, not necessarily to a Telegram profile
// or channel.
// Profile link, opened when users click on the author's name below the title. Can be any
// link, not necessarily to a Telegram profile or channel.
args.Add("author_url", page.AuthorURL)
}

Expand Down
10 changes: 4 additions & 6 deletions edit_account_info.go
Expand Up @@ -5,9 +5,8 @@ import (
http "github.com/valyala/fasthttp"
)

// EditAccountInfo update information about a Telegraph account. Pass only the
// parameters that you want to edit. On success, returns an Account object
// with the default fields.
// EditAccountInfo update information about a Telegraph account. Pass only the parameters that you
// want to edit. On success, returns an Account object with the default fields.
func (account *Account) EditAccountInfo(update *Account) (*Account, error) {
args := http.AcquireArgs()

Expand All @@ -20,9 +19,8 @@ func (account *Account) EditAccountInfo(update *Account) (*Account, error) {
// New default author name used when creating new articles.
args.Add("author_name", update.AuthorName)

// New default profile link, opened when users click on the author's name
// below the title. Can be any link, not necessarily to a Telegram profile
// or channel.
// New default profile link, opened when users click on the author's name below the title. Can be
// any link, not necessarily to a Telegram profile or channel.
args.Add("author_url", update.AuthorURL)

body, err := request("editAccountInfo", "", args)
Expand Down
8 changes: 3 additions & 5 deletions edit_page.go
Expand Up @@ -7,8 +7,7 @@ import (
http "github.com/valyala/fasthttp"
)

// EditPage edit an existing Telegraph page. On success, returns a Page
// object.
// EditPage edit an existing Telegraph page. On success, returns a Page object.
func (account *Account) EditPage(update *Page, returnContent bool) (*Page, error) {
args := http.AcquireArgs()

Expand All @@ -24,9 +23,8 @@ func (account *Account) EditPage(update *Page, returnContent bool) (*Page, error
}

if update.AuthorURL != "" {
// Profile link, opened when users click on the author's name below
// the title. Can be any link, not necessarily to a Telegram profile
// or channel.
// Profile link, opened when users click on the author's name below the title. Can be any
// link, not necessarily to a Telegram profile or channel.
args.Add("author_url", update.AuthorURL)
}

Expand Down
4 changes: 2 additions & 2 deletions get_account_info.go
Expand Up @@ -34,8 +34,8 @@ func (account *Account) GetAccountInfo(fields ...string) (*Account, error) {
// Access token of the Telegraph account.
args.Add("access_token", account.AccessToken) // required

// List of account fields to return. Available fields: short_name,
// author_name, author_url, auth_url, page_count.
// List of account fields to return.
// Available fields: short_name, author_name, author_url, auth_url, page_count.
args.Add("fields", fmt.Sprint(`["`, strings.Join(fields, `","`), `"]`))

body, err := request("getAccountInfo", "", args)
Expand Down
15 changes: 7 additions & 8 deletions get_views.go
Expand Up @@ -19,26 +19,25 @@ func GetViews(path string, hour, day, month, year int) (*PageViews, error) {
args := http.AcquireArgs()

if hour > -1 {
// If passed, the number of page views for the requested hour will
// be returned.
// If passed, the number of page views for the requested hour will be returned.
args.Add("hour", strconv.Itoa(hour))
}

if day > 0 {
// Required if hour is passed. If passed, the number of page views
// for the requested day will be returned.
// Required if hour is passed. If passed, the number of page views for the requested day will
// be returned.
args.Add("day", strconv.Itoa(day))
}

if month > 0 {
// Required if day is passed. If passed, the number of page views
// for the requested month will be returned.
// Required if day is passed. If passed, the number of page views for the requested month will
// be returned.
args.Add("month", strconv.Itoa(month))
}

if year > 0 {
// Required if month is passed. If passed, the number of page views
// for the requested year will be returned.
// Required if month is passed. If passed, the number of page views for the requested year
// will be returned.
args.Add("year", strconv.Itoa(year))
}

Expand Down
7 changes: 3 additions & 4 deletions revoke_access_token.go
Expand Up @@ -5,10 +5,9 @@ import (
http "github.com/valyala/fasthttp"
)

// RevokeAccessToken revoke access_token and generate a new one, for example,
// if the user would like to reset all connected sessions, or you have reasons
// to believe the token was compromised. On success, returns an Account object
// with new access_token and auth_url fields.
// RevokeAccessToken revoke access_token and generate a new one, for example, if the user would
// like to reset all connected sessions, or you have reasons to believe the token was compromised. On
// success, returns an Account object with new access_token and auth_url fields.
func (account *Account) RevokeAccessToken() (*Account, error) {
args := http.AcquireArgs()

Expand Down

0 comments on commit 4cb87b4

Please sign in to comment.