Giter VIP home page Giter VIP logo

mathematica-btools's Introduction

โ€Œ

BTools

version license

The BTools application is a multi-use Mathematica application, largely devoted to simplifying the development process. The application has an autoloader primary file that exposed package-scoped helper functions and loads all of the packages in the Packages directory into the main context.


โ€Œ

Installation

The easiest way to install these packages is using a paclet server installation:

PacletInstall[
  "BTools",
  "Site"->
    "http://www.wolframcloud.com/objects/b3m2a1.paclets/PacletServer"
  ]

If you've already installed it you can update using:

PacletUpdate[
  "BTools",
  "Site"->
    "http://www.wolframcloud.com/objects/b3m2a1.paclets/PacletServer"
  ]

Alternately you can download this repo as a ZIP file and put extract it in $UserBaseDirectory/Applications


Examples and usages can be found on the Wiki

mathematica-btools's People

Contributors

b3m2a1 avatar kubapod avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mathematica-btools's Issues

Git commit message

What is the syntax to provide a commit message or in general an argument for an option?

Git["commit", "-m test"] (or)
Git["commit", "-m", "test"]

both end up with 'Commited by Mathematica'.

What is the Config folder?

  1. Is the config folder defined by yourself, can I extend the definition inside?

  2. What do the files inside mean?

  3. Is it possible to provide something like $PackageConfig, which can be used to conveniently store persistent data?

$PackageConfig["RemovePath", Bundle] = XXX

May works like InitializationValue and PersistentValue

GitHub thinks every method needs authorization

<< BTools`External`
GitHub["ListRepositories", "b3m2a1"]

It will ask you to login, you can login provide wrong credentials or cancel and it will return ListRepositories result anyway. It should not ask I guess.

BTools / Git autocompletion

As per se post Git[" is supposed to trigger autocompletion menu, which it does not for me. (v2.1.27 MMA v11.3+ Win7/10)

BTools["AllowAutocompletions"]

BToolsPackageScopePrivateConstants$TopLevelLoad

Development use cases outline

TL;DR;

It would be nice to have a short wiki with common development use cases / step and corresponding functions that achieve those goals.

Background

Very often I don't need golden hammer solutions but an access to those tiny features. I believe I'm not the only one as for anything more complex than a package there is hardly any widely established standard.

Todo

So, in order to list those functions / lack of them we need to prepare a list of steps / use cases.

Here is a start, it is biased so needs to be refactored and extended before publishing.

Creation / Development

  • newProject(type)
  • newProjectContent(type) (todo: expand)
  • createPacletInfo(initAssociationWithRequiredFields)
  • mmaProjectGitInit()
  • createTests()

Build dev/prod

PacletInfo:

  • modifyPacletInfo(key:value)
  • handy PI getters
  • incrementVersion(major|minor|patch : patch)
  • addExtension(fe|docs|resource)

Kernel:

  • addSubpackage(packageTemplateType)

FrontEnd

  • addStylesheet()

Documentation:

  • newDocPage(sym|tutorial|guide|...)
  • buildDocs()

Tests:

  • runTests()

Resources:

...

Git:

Release / Deployment

  • gitTag() // at least git tag -a -m {most recent feat(_) commit msg} v{paclet version}
  • release as github asset

The idea is to outline more than it is to know which features need care.

DocGen: CellContext of documentation files

A small suggestion for DocGen family.

Since the target group are third party packages maybe generated symbols etc. notebooks should have CellContext -> Notebook or even Global` , though Notebook will be better.

The reason is Needs["myPackage`"] in an intialization cell does not do much since every cell group has separate $ContextPath. One still needs to use full names or change CellContext themself, which will be confusing for newbies.

How to declare an external package?

This is the case in the ordinary case:

BeginPackage["xxx`",{"JLink`"}]
Begin["`xxx`"]

JavaNew["..."]

End[]
EndPackage[]

Now with the Loader.m, no longer needed write BeginPackage.

But also can't specify Contexts, so I must write:

Begin["`xxx`"]

JLink`JavaNew["..."]

End[]

Is there any way to add JLink to all sub-packages?

Some questions about the directory

First can't use Get to import the created package.

Because "%\\AppData\\Roaming\\Mathematica\\Paclets\\Applications" doesn't in the $Path.


Second, what else should I do after I create a package named "mytest.m" in "\\Package".

I tried <<mytest` but Get can't find the path.


Moreover, buttons in Docs run but nothing was generated in "\\Documentation".

GenerateSymbolPages@fun works fine butGenerateDocumentation@"DocGen`" only return a empty notebook says

There are no symbols in the DocGen context.

Maybe I missing some settings.

Unable to perform simple HTML generation

Hi there,

[MacOS 10.14, Mathematica 11.2]

I'm not sure if this repo is still being maintained; if not, please point me to whatever these tools have since become!
I'm trying to generate HTML doc of a paclet (one of your own, as a test).

I've installed BTools, and its doc, via

PacletInstall["BTools", "Site" -> "http://www.wolframcloud.com/objects/b3m2a1.paclets/PacletServer"]
PacletInstall["Documentation_BToolsWeb", "Site" -> "http://www.wolframcloud.com/objects/b3m2a1.docs/DocumentationServer"]

I try to generate HTML doc (as a test) via

<< BTools`Paclets`

DocGen["HTML", PacletFind["Documentation_BToolsWeb"]]

but after some fuss, the DocGen call throws:

Throw: Uncaught Throw[False] returned to top level

I can see it has only generated files css, images and javascript at Mathematica/ApplicationData/DocGen/Web, but nothing more.

Running DocGen["HTML", PacletFind["Documentation_BToolsWeb"]] agains spits out more errors which indicate those created files were intended as directories. Starting over, and creating css, images, javascript directories in advance, offers new errors of

LinkObject: Argument I'm trying to get rid of this in I'm trying to get rid of this is not a valid LinkObject

I suppose the project isn't in a working state for MacOS; is there another way I can generate Mathematica Doc Centre style HTML documentation using BTools, or a derivative project?

Supported WolframVersion

Due to BTools' heavy use of URLRead I think it requires 11+ restriction. Or at least messages for features affected by missing functionalities.

Git HelpDescriptions

On Windows

Git["HelpDescription", "add"]

None

Because git is launching web docs for git help.

Not possible to authenticate in GitHub after initially providing incorrect credentials

Let's e.g. GitHub["CreateRepository", "temp"]. It will ask you to login with BTools' dialog (blue header). If credentials are invalid the second prompt will be different, I guess it is the native one but it is slightly different than the default for URLRead and friends. Anyway, whatever you put there you will get 401 response, even if this time credentials were ok.

Can you reproduce the problem?

git reset HEAD~

Git["reset","HEAD~"]

fatal: 'HEAD~' does not appear to be a git repository
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists."

What am I doing wrong?

cmd version returns:

Unstaged changes after reset:
M path/to/file

Some questions about the documentation

Now let's talk about the documentations generation.

First I load my application.

Then run some functions to activate all packages

At last, using GenerateDocumentation to generate the documentations.


I find that in "%AppData%\Roaming\Mathematica\ApplicationData\DocGen\DocPaclets".

Everything works good, but when I copy them to "myPackage\Documentation", all links are broken.

And all the documentations can't be found by searching or F1.

Deprecated code in DocGen

The function System`Private`HasOwnCodeQ doesn't exist anymore in V13.3 and therefore the argument to If is neither True/False. This results in the whole block being included as a string in the generated notebook.
ASFAIK there is only one instance of this function in use in Packages/Paclets/DocGen/SymbolPages.m.

WolframCloud b3m2a1 packlets not available anymore?

When trying to run :

PacletInstall["ServiceConnection_GoogleDrive", 
 "Site" -> 
  "http://www.wolframcloud.com/objects/b3m2a1.paclets/PacletServer"]

I get these errors:

PacletSiteUpdate::err: An error occurred attempting to update paclet information from site http://www.wolframcloud.com/objects/b3m2a1.paclets/PacletServer. Server returned HTTP status code 401.

PacletInstall::notavail: No paclet named ServiceConnection_GoogleDrive is available for download from any currently enabled paclet sites.

External raw calls

What if the API gateway, e.g. GitHub does not support a specific method due to whatever reason? Is there a natural way to make that call anyway? If not, there should be :)

If there is no general way, it should be mentioned what internal functions can be used to assemble the call.

With respect to GitHub only authorization patch is needed and I guess many will be fine with writting HTTPRequest by themselves.

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.