Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add syntax highlighting #14

Open
gerbenvandijk opened this issue Jul 14, 2016 · 6 comments
Open

add syntax highlighting #14

gerbenvandijk opened this issue Jul 14, 2016 · 6 comments

Comments

@gerbenvandijk
Copy link

Slack usually let's you set a syntax for snippets, perhaps this is possible with the plugin as well?

Thanks, super useful plugin!

@gerbenvandijk
Copy link
Author

And linenumbers corresponding to the actual ones would be amazing

@b-sharpe
Copy link
Owner

currently there is no way to beautify input via snippets. The API only allows attachments or pre-text unfortunately. For the line numbers, I'm not sure what you mean, it currently does display the lines selected within the file?

@Nguimjeu
Copy link

Nguimjeu commented Dec 9, 2016

@b-sharpe I yeah that would be really if there were some kind of syntax highlighting option (Integrate Markdown support?). As for the line numbers I think @gerbenvandijk had something like in the attached screenshot in mind (which would also be really cool to have)

Snippet styled with Markdown

public function sendToSlack($message)
{
    $this->submit($message);
}

PhpStorm screenshot: line numbers.

line_number_syntax_high

@qikkeronline
Copy link

i might be wrong here, but isn't it possible by setting the file type of a snippet @b-sharpe ?

https://api.slack.com/types/file -> scroll down to "file types":

Possible filetype values include, but are not limited to the following:\
auto	Auto Detect Type
text	Plain Text
applescript	AppleScript
boxnote	BoxNote
c	C
csharp	C#
cpp	C++
css	CSS
csv	CSV
clojure	Clojure
coffeescript	CoffeeScript
cfm	Cold Fusion
d	D
dart	Dart
diff	Diff
dockerfile	Docker
erlang	Erlang
fsharp	F#
fortran	Fortran
go	Go
groovy	Groovy
html	HTML
handlebars	Handlebars
haskell	Haskell
haxe	Haxe
java	Java
javascript	JavaScript/JSON
kotlin	Kotlin
latex	LaTeX/sTeX
lisp	Lisp
lua	Lua
markdown	Markdown (raw)
matlab	MATLAB
mumps	MUMPS
ocaml	OCaml
objc	Objective-C
php	PHP
pascal	Pascal
perl	Perl
pig	Pig
post	Slack Post
powershell	PowerShell
puppet	Puppet
python	Python
r	R
ruby	Ruby
rust	Rust
sql	SQL
sass	Sass
scala	Scala
scheme	Scheme
shell	Shell
smalltalk	Smalltalk
swift	Swift
tsv	TSV
vb	VB.NET
vbscript	VBScript
velocity	Velocity
verilog	Verilog
xml	XML
yaml	YAML

@b-sharpe
Copy link
Owner

@Nguimjeu @qikkeronline Unfortunately inline line numbers and code formatting are not something you can do via a incoming webhook, basically you are bound to what can be done here: https://api.slack.com/docs/messages/builder

The file types link is for attaching actual files via https://api.slack.com/methods/files.upload which is using the Web API + OAuth rather than webhooks

@qikkeronline
Copy link

Clear, thanks for explaining @b-sharpe 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants