GithubHelp home page GithubHelp logo

devtools's Introduction

(please consider it beta before it hits 1.0.0)

What's there?

Installation / Updating

  • Manual way

    Go to 'releases' tab and download appropriate .paclet file.

    Run PacletInstall @ path/to/the.paclet file

  • via MPM

    (*If you don't have MPM` yet*)
    Import["https://raw.githubusercontent.com/kubapod/mpm/master/install.m"] 
    
    Needs @ "MPM`"   
    MPM`MPMInstall["kubapod", "devtools"]
    
    (* now see 'Setup dark stylesheet with all features' section below*)      
    

Uninstall

  PacletUninstall /@ PacletFind["DevTools"];
  DeleteDirectory[FileNameJoin[{$UserBaseDirectory, "AppliactionData", "DevTools"}], 
    DeleteContents -> True
  ];

Quick Guide

Setup dark stylesheet with all features

In order to use the stylesheet as a default one for .m/.wl files, run:

  CurrentValue[$FrontEnd, "DefaultPackageStyleDefinitions"
  ] = FrontEnd`FileName[{"DevTools", "DevPackageDark.nb"}]

And if you don't like it:

  CurrentValue[$FrontEnd, "DefaultPackageStyleDefinitions"
  ] = "Package.nb"

Code templates

Templates menu is available in DevPackageDark.nb stylesheet mentioned above. This stylesheet is not tested for regular notebooks yet but if you want to enable templates menu for any notebook you can run:

Needs @ "DevTools`";
CodeTemplatesEnable[];

Templates menu can be opened with Ctrl + 1 shortkey.

Custom code templates can be added via package toolbar / Templates&Actions / EditCodeTemplates item.

  <| "Template" -> _String | _RowBox (*the only one which is reqiired*)
   , "Label" -> _
   , "ShortKey" -> _?(StringMatchQ[Character])
   , "ExpandSelection" -> _boole:True
   , "Preview" -> _ : None
  |>
  • Template

    • _RowBox : whatever PasteButton can handle it should too
    • _String : StringTemplate syntax with `sel` as a placeholder for a selection data. This needs to be polished as it assumes the selection will be a single token, not a BoxForm.
  • Label, menu item label, is optional but for longer templates it is encouraged.

  • ShortKey, optional, with opened menu it will automatically launch associated template

  • ExpandSelection: whether to expand selection if nothing is selected

  • Preview should be automatically generated form "Template" (unless Template was used as a Label). You can use whatever you want as a preview though.

Alt text

Notebook actions

They are very similar to templates feature.

Actions menu is available in DevPackageDark.nb stylesheet mentioned above. This stylesheet is not tested for regular notebooks yet but if you want to enable actions menu for any notebook you can run:

Needs @ "DevTools`";
NotebookActionsEnable[];  (*NotebookActionsDisable[] to revert changes*)

Difference is that the menu with actions is invoked by Ctrl + , and an action item should look like this:

 <|                        (*!!!   DON'T FORGET ABOUT :> FOR THE ACTION !!! *)       
 "Label"    -> _String,
 "ShortKey" -> _String,
 "Action"   :> foo[]   
 |>   

devtools's People

Contributors

kubapod avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.