Giter Club home page Giter Club logo

Comments (5)

mscolnick avatar mscolnick commented on September 27, 2024

could it be header_comment or just header in the markdown? since it would be nice to preserve these comments and since both script and nix are slightly different in their comment structuer

from marimo.

dmadisetti avatar dmadisetti commented on September 27, 2024

That would be nice because there might be other header comments that could be leveraged.
Arguments for having sections:

  • Most / single hashbangs aren't useful since .md files aren't runnable
  • writing the env becomes more cumbersome and prone to error
  • In the header form (even with # stripped out), the block would still have to be parsed to be usable and require sandbox / nix particular logic for the consumer

from marimo.

mscolnick avatar mscolnick commented on September 27, 2024

the block would still have to be parsed to be usable and require sandbox / nix particular logic for the consumer

Why does it? Why can't we just not touch the header and leave it as is? I don't think marimo can/should be opinionated on how to construct the env, especially since there isn't one way.

from marimo.

dmadisetti avatar dmadisetti commented on September 27, 2024

I think there should be parity with the python format. So even if there isn't a nix section, maybe there should be a sandbox section that extracts the relevant # /// script section. Even though there's not one way to bootstrap an env, the marimo seems to be embracing the PEP specification

from marimo.

mscolnick avatar mscolnick commented on September 27, 2024

Could we not go a level higher, and instead of preserving # /// script, we just preserve the whole comment as-in without any modification?

---
title: Notebook
marimo-version: 0.0.0
width: medium
comment: |
    #! /usr/bin/env nix
    #! nix shell --impure --expr ``
    #! nix with (import (builtins.getFlake ''nixpkgs'') {});
    #! nix    python311.withPackages (
    #! nix            ps: with ps; [ marimo uv setuptools ]
    #! nix    )
    #! nix ``
    #! nix --command marimo edit --sandbox
    # /// script
    # requires-python = ">=3.11"
    # dependencies = [
    #     "numpy",
    # ]
    # ///
---   

from marimo.

Related Issues (20)

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.