-
-
Notifications
You must be signed in to change notification settings - Fork 294
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
reorder cells in GUI according to order of command execution #270
Comments
Personally, I use this function: function sortcell(filename::String, outfile = filename)
cells = filter(startswith("# ╔═╡"), (collect ∘ eachline)(filename))[1:end-1]
cells = map(cells) do cell
replace(cell, "# ╔═╡" => "# ╠═")
end
cells = join(cells, "\n")
file = read(filename, String); print(cells)
file = replace(file, r"(\n?# ╠═.+)+" => "\n$cells")
write(outfile, file)
end It's not elegant, but it works. |
Why would it be useful? |
It would be helpful for enhancing the readability of the code which already became developed. Using an interactive coding style for testing something on the code, and finally having found a solution to a problem, it could be helpful to not only find the sequence of execution in the file.jl, but to also use this sequence of execution as the new sequence for listing the code also in Pluto before continuing with works on the code. I think it many times could enhance readability of developed code if cells in Pluto as an option could be reordered to the order of command execution as by now only found in the file.jl. I would not suggest to force such reordering to always become applied, but, as the word suggests, provide such reordering as an "option". |
Could you summarize? |
I don't feel like this should be part of Pluto's UI, because it adds a complicated button, and it makes reactivity feel like something to avoid, instead of a feature. But @ndgnuh, feel free to add that script to https://github.com/fonsp/PlutoUtils.jl |
My script feels hacky (it relies on those comments at the beginning of the line). So while it works, I don't think it should go in a package. |
in that case, play around with this: Just reorder |
suggestion: option to reorder the cells in the "Pluto web GUI editor" according to the order of command execution;
the created file.jl has this order already established for the commands, so that the file.jl could serve as a normal Julia script; it would be fine if by a function in the GUI, or at least when opening the file.jl again, there would be an option to apply the execution order as the new presented cell ordering in the GUI;
The text was updated successfully, but these errors were encountered: