Skip to content

Command line interface to help generate proper code syntax, pulled from documentation

License

Notifications You must be signed in to change notification settings

alishalabi/syntax-helper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Maintenance Ask Me Anything ! Documentation Status GitHub issues Awesome Badges LicenseGo Report Card

Syntax Helper CLI

Syntax Helper is a CLI that helps developers quickly get access to built-in code syntax. Syntax Helper supports a variety of code packages for both Golang and Python. Data is scrapped directly from https://golang.org/pkg/ & https://docs.python.org/3/library/.

Installation

Install locally using:

git clone [email protected]:alishalabi/syntax-helper.git

Install using go get command:

go get github.com/alishalabi/syntax-helper

Usage

asciicast

  • Note: All functionality requires broadband connection

Get all Golang functions for given package name:

./syntax-helper golang <pkg-name>

Example:

$ ./syntax-helper golang unsafe                
func Alignof(x ArbitraryType) uintptr
func Offsetof(x ArbitraryType) uintptr
func Sizeof(x ArbitraryType) uintptr
type ArbitraryType
type Pointer

Get syntax for specific public function from package (Note: function names all begin with a capital letter)

./syntax-helper golang <pkg-name> <function-name>

Example:

$ ./syntax-helper golang unsafe Offsetof
Function Syntax:
func Offsetof(x ArbitraryType) uintptr
For Synatx example:
$ ./syntax-helper golang unsafe Offsetof example

Get example of specific public function from package (Note: function names all begin with a capital letter)

./syntax-helper golang <pkg-name> <function-name> example

Example:

$ ./syntax-helper golang fmt Fprintf example    
Function Example:
package main

import (
	"fmt"
	"os"
)

func main() {
	const name, age = "Kim", 22
	n, err := fmt.Fprintf(os.Stdout, "%s is %d years old.\n", name, age)

	// The n and err return values from Fprintf are
	// those returned by the underlying io.Writer.
	if err != nil {
		fmt.Fprintf(os.Stderr, "Fprintf: %v\n", err)
	}
	fmt.Printf("%d bytes written.\n", n)

}

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

Milestones

  • Generate skeleton structure
  • Implement Golang command
  • Implement Golang package parameter
  • Implement Golang function parameter
  • Implement Golang function example parameter
  • Implement Go-Colly to populate messages
  • Implement Python command
  • Implement Python package parameter
  • [] Implement Python function parameter
  • [] Implement Python function example parameter
  • Finalize ReadMe.md
  • Implement badges
  • [] Deploy as Homebrew package

License

Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

ForTheBadge built-with-love

About

Command line interface to help generate proper code syntax, pulled from documentation

Resources

License

Stars

Watchers

Forks

Packages

No packages published