1. 12
    1. 9

      +100 points for sync scrolling! I’ve been using MarkDown Pro on Mac for a couple years and it still doesn’t have this feature. Will give this a try.

      1. 1

        Thanks! Do let me know your feedback about it.

      2. 16

        Can I get a “Hates Electron” hat?

        It looks like you made a web version! - I wish everyone that made electron “apps” had the foresight to make web version (do they even need to be different repo?!). There is a lot more potential for your app now that it isn’t encumbered by electron! Someone can turn it into a service or run it on a BSD!

        I’d also like to nip something in the bud.. electron (and anything built on top of it) is not “mimimal”. It might have taken you very little code to produce said thing.. but electron is very very not minimal.

        Here is some data to chew on:

        Electron (66846bff975f92dd721d5ca29f332edf3795f1c0)
        -----------------------------------------------------------------------------------
        Language                         files          blank        comment           code
        -----------------------------------------------------------------------------------
        C++                                312           9711           4385          46244
        Markdown                           513          18985              0          43674
        JavaScript                         199           2979           1012          22966
        C/C++ Header                       337           5855           4674          19227
        Objective C++                       47           1573            713           6642
        Python                              39            911            288           2909
        HTML                               123            102              0           1885
        YAML                                 5             23             16            347
        Bourne Shell                         8             74             70            309
        JSON                                15              3              0            243
        Windows Resource File                1             21             33             85
        Bourne Again Shell                   7             23             21             70
        Dockerfile                           1              5              4              9
        PowerShell                           1              0              0              2
        CSS                                  1              0              0              1
        CoffeeScript                         1              0              0              1
        -----------------------------------------------------------------------------------
        SUM:                              1610          40265          11216         144614
        -----------------------------------------------------------------------------------
        
        Chromium (61.0.3163.100)
        qbit@slip[0]:chromium-61.0.3163.100λ cloc .                 
          209609 text files.
          189475 unique files.                                          
        Out of memory!800
        panic: POPSTACK
        qbit@slip[1]:chromium-61.0.3163.100λ 
        
        Entire OpenBSD src tree (includes clang and gcc)
        ---------------------------------------------------------------------------------------
        Language                             files          blank        comment           code
        ---------------------------------------------------------------------------------------
        C                                    16045        1151514        1394479        6409501
        C++                                   9027         380730         428645        2129520
        C/C++ Header                         12480         401032         766593        2026578
        Perl                                  4122         157859         208622         982209
        HTML                                   903          33457           6243         471775
        Bourne Shell                          1298          62248          76580         469701
        Markdown                               259          46737              0         402916
        PO File                                129         141599         190451         319672
        Python                                1208          31439          29325         120108
        Assembly                               896          19716          53416         107674
        yacc                                    89          13030           8543          99830
        Expect                                 459          14444          21708          74919
        make                                  2271          14044           7875          59234
        m4                                     179           6227           3099          54859
        Windows Module Definition              179           5820             41          43062
        ASP.Net                                  2           1013             18          24720
        TeX                                     19           3073          12237          21050
        CMake                                  660           3043           2162          20623
        Lisp                                   104           1551            455          13386
        Pascal                                  42           2045           6029          10822
        lex                                     32           1620           1791           9035
        Fortran 77                             183            893           2886           7495
        Objective C                            201           1772            830           6473
        Objective C++                           16           1019            998           6024
        awk                                     51            500           1384           4363
        OCaml                                   59           1355           2442           4100
        Go                                      28            544            655           3876
        Fortran 90                              73            264            818           3457
        XML                                     36            193             53           3389
        CSS                                     22            528            251           3087
        Korn Shell                              12            565            958           2738
        YAML                                    52             20            113           2186
        sed                                     47            221            596           1851
        Antlr                                    2              0              0           1726
        DOS Batch                               29            258             97           1507
        JSON                                    21              3              0           1190
        JavaScript                               6            106            182            856
        Racket                                   3             76            132            626
        C#                                       8             87            108            557
        Bourne Again Shell                       7            111            196            532
        Forth                                    1             96            123            497
        Windows Message File                     1            102             11            489
        vim script                               9             60             78            395
        Mathematica                             93             18              0            350
        DTD                                      1             91             58            335
        MSBuild script                           1              0              7            254
        R                                       32             26             12            252
        diff                                    20             37            248            248
        Windows Resource File                    7             35             12            194
        XSLT                                     1             46              9            187
        MATLAB                                   6             69              3            173
        C Shell                                  2             17             22            132
        GLSL                                     1             16              0             61
        Protocol Buffers                         1             47            168             47
        Java                                     3              5             24             47
        Prolog                                   4             30             -1             44
        D                                        6              7              7             42
        Dockerfile                               6             26             90             38
        SAS                                      1             14             21             29
        Ada                                      4             13             45             23
        NAnt script                              1              0              0              9
        INI                                      1              1              0              6
        Standard ML                              2              0              0              4
        Lua                                      1              0              1              2
        ---------------------------------------------------------------------------------------
        SUM:                                 51464        2501512        3231949       13931085
        ---------------------------------------------------------------------------------------
        

        If someone else wants to run cloc on the chromium tree - I would love to see the complete output!

        1. 2
           ryzen chromium/src [287861b160] » time loc -uu
          --------------------------------------------------------------------------------
           Language             Files        Lines        Blank      Comment         Code
          --------------------------------------------------------------------------------
           C++                  51006     16769880      2144056      1660815     12965009
           Plain Text           52868      7840453       186175            0      7654278
           C/C++ Header         44407      6524647      1001316      1603227      3920104
           HTML                 67998      4149634       440243       206856      3502535
           C                     8773      4570335       541083       691917      3337335
           JavaScript           24789      4317194       494352       888292      2934550
           Python               12200      2650721       424870       258194      1967657
           JSON                  5696      1813849         2895            0      1810954
           Assembly              1561       975142        67340        23191       884611
           Java                  4417       967647       124617       191860       651170
           Hex                    351       602556            0            0       602556
           Objective-C++         3278       649941       100102        73113       476726
           XML                   2338       506560        38555        15844       452161
           Markdown              1910       263887        68139            0       195748
           GLSL                  6800       334925        46917       138825       149183
           CSS                   1729       120394        16977         8405        95012
           Makefile              1137       127804        16903        18113        92788
           Bourne Shell           821       126147        15239        22305        88603
           Perl                   196        88120         9900         8442        69778
           Objective-C            231        87862        11087         9129        67646
           Autoconf               367        69611         5883         7138        56590
           C#                     226        76446         7066        13049        56331
           Go                     115        55798         5386         5570        44842
           reStructuredText       299        55210        15199            0        40011
           INI                     25        41413         3327            5        38081
           Tcl                    134        39870         3773         6628        29469
           Protobuf               536        59063         8600        21791        28672
           PHP                    752        37499         3868         7485        26146
           YAML                   239        28976         2569          738        25669
           Yacc                    13        18205         1731         1457        15017
           Ruby                    36         6653          896          473         5284
           OCaml                   71         9685         1782         2796         5107
           Batch                  121         7016          991         1008         5017
           SQL                    145         4792          157          236         4399
           Lua                     31         4975          574          459         3942
           Sass                    35         3246          468          607         2171
           Lisp                    20         2594          291          441         1862
           TypeScript              34         3021          399         1067         1555
           TeX                      3         1875          286          238         1351
           Jsx                      5          849          112           60          677
           LinkerScript             3          584           15            0          569
           VimL                    13          774          117          191          466
           Swift                    2          469           53           58          358
           Awk                      2          291           53           55          183
           ASP.NET                176          176            0            0          176
           CUDA                     1          212           15           33          164
           R                        2          160           17           27          116
           Coq                      9           75            0            0           75
           Handlebars               7           70            4            0           66
           CoffeeScript             7           89           11           21           57
           ActionScript             1           75           18            0           57
           Prolog                   1           25            4            0           21
           Z Shell                  1           25            4           15            6
          --------------------------------------------------------------------------------
           Total               295938     54017520      5814435      5890174     42312911
          --------------------------------------------------------------------------------
          loc -uu  11.45s user 7.23s system 445% cpu 4.191 total
          
          1. 1

            42312911

            whoa, I got 28,103,031 on chromium 61.0.3163.100! I wonder what the difference is - did you run depot-tools?

            1. 2

              I got 33 million with cloc earlier but don’t want to run it again to try to figure out what I’m either getting wrong or they’re ignoring. Was using my own thing: https://github.com/cgag/loc/

              Oh, I see you posted the output of cloc in another comment. I see I’m counting 7.6 million lines of plain text. I don’t know why I do that, but subtracting that out gets me down to 34 million which is reasonably close. Also finding far more HTML .

              I did use depot-tools, I think I’m at head.

              edit: I get a very similar count to tokei when I respect .gitignore like it does so I think mines reasonably accurate.

              1. [Comment removed by author]

            2. 2

              So I got the output from chromium!

              So Electron (144,614) and Chromium (28,103,031) mean that electron’s “code base” is 28,247,645 lines of code long. 13.9 million more than a fairly feature complete OS!

              1. 1

                What is your point? You’re comparing a browser and an operating system (which is orders of magnitude larger and more complex).

                Electron is fast to run (even on older hardware and laptops) and easy to build apps with, Slack is a terribly built application but is still the only one people mention when talking about Electron.

                Granted, I would probably use a Gecko version of electron if I could, but I am not aware of any projects like that.

                1. 3

                  (which is orders of magnitude larger and more complex).

                  The point is that the browser is “magnitude larger and more complex” than a complete operating system. Electron is by no means fast to run, the memory usage is over the top and its not portable to systems they don’t support because of the enormous complexity.

                  The way how electron is designed makes it impossible to have a shared runtime, which would reduce the amount of work to add electron based programs to distributions package managers or ports systems.

                  Its not feasible to build a whole browser for each electron app.

                  1. 1

                    I’m confused, you say that Electron is larger, but the numbers you posted don’t follow that: Electron: 1610 files, 144614 LOC OpenBSD: 51464 files, 13931085 LOC

                    Electron is by no means fast to run, the memory usage is over the top

                    I’ll say it again, that is the individual application’s responsibility. Most JS devs don’t know how to be memory safe.

                    not portable to systems they don’t support because of the enormous complexity

                    This is a legitimate complaint, but is a solvable problem. It’s possible to support FreeBSD and OpenBSD in the near future (as far as I know).

                    I’ll admit that a shared runtime would be advantageous from a package managment standpoint, but then you need the latest runtime for one app, but that breaks another and it becomes a big mess.

                    1. 2

                      Out of memory!800

                      panic: POPSTACK

                      while running cloc on chromium, it never finished.

                      1. 1

                        Why don’t you try running it on OpenBSD?

                        1. 5

                          What? The post from @qbit includes cloc of the OpenBSD source tree and includes the attempt to run it on the chromium source.

                          The point is that chromium is too larger to even run cloc on it, while you can completely scan the OpenBSD tree.

                          https://www.quora.com/How-many-lines-of-code-is-Google-Chrome

                          1. 1

                            Oh, I misunderstood your first post, I didn’t understand that the tables were the output of cloc (I’ve never used it before). I see what your saying now, but my point still stands, JS devs are the problem, not Electron.

                          2. 2

                            Are you taking about electron or cloc of chromium? - because I have tried electron and that cloc cmd above was run on OpenBSD.

                            1. 1
                    2. 3

                      Yeah, my point is that an entire OS* src tree is orders of magnitude smaller than the chromium source (which is included when you build electron apps!!)!

                      (*) With awesome things like:
                      • acme client
                      • perl
                      • dns server
                      • http server
                      • dhcp server
                      • clang
                  2. 3

                    MacDown is a good macOS native alternative to this.

                    1. 2

                      I personally use Marked2, which is kind of like a sidecar app – you edit in your editor of choice, and marked just renders the markdown for you in a floating window.

                      1. 2

                        +1 - I find the lack of GitHub Enterprise full screen in-browser editing support annoying, so I tend to write up a comment using MacDown so I don’t have to flip between Edit and Preview in GHE.

                      2. [Comment removed by moderator pushcx: don't make "hate posts"]

                        1. 4

                          And Direct3D. But for an electron app it really is minimal: only 145.3 MiB on disk.

                          1. 3

                            I mean, you sort of need a browser to render markdown.

                            1. 3

                              Isn’t the point of markdown the ability to see ‘formatted’ text without rendering it as HTML? I’ve never really understood the value of these markdown editors, given that the most complex thing in MD seems to be lists

                              1. 4

                                What makes you think you need a browser for simple text formatting?

                                1. 8

                                  Markdown has full support for inline HTML.

                                  It’s even so central to the language that it’s literally the second section in the original markdown document

                                  1. 3

                                    Never saw this, but I guess that comes from all the different markdown flavors.

                                    But ok, use electron for this and call it minimal, I don’t have to care if I don’t use it.

                                    Edit: But using some webkit view from gtk or qt would make it less of a problem for me as someone who packages software for a linux distribution. Packaging electron apps is just not feasible because we need patches for it to support musl libc and building it over and over again for each electron app is just wrong.

                                    1. 4

                                      I find your comment particularly infuriating.

                                      Your original post was a lowbrow dismissal of someone’s work couched with irony to provide plausible deniability. Even then, you knew it wasn’t the right thing to do.

                                      You then showed that you hadn’t even bothered to understand the field before dismissing the project.

                                      You then did another lowbrow dismissal comment, but then followed it up with an edit, in which you suggested:

                                      1. the developer take a hard dependency and rewrite their entire software in one of two perennially buggy, flaky, fast-moving and platform-locked desktop linux frameworks, just because it would make your life as a linux software packager easier

                                      2. it’s impossible to package electron apps because you have to do work to compile it and that makes you sad

                                      I’m trying to imagine scenarios under which you could express more entitlement or lack of respect for people who actually do work, but they’re not coming to me. Additionally, if the job of packaging software is too hard for you, maybe stop doing it.

                                      1. 6

                                        After your edit this is a much more informative post than your top level one dissing the project. Perhaps you could lead with something more like this next time?

                                        1. 3

                                          To my understanding, though, there’s no good quick solution to package GTK and QT applications to OS X/Windows, which - to my understanding - is one of the main reasons people pick electron?

                                          1. 1

                                            Edit: But using some webkit view from gtk or qt would make it less of a problem for me

                                            I maintain the OpenBSD port for ghostwriter, it’s pretty minimalistic and uses qt5 webkit view.

                                        2. 2

                                          There are much nicer ways to make a technical point than this. Please use one of them in the future.

                                      2. 5

                                        A “minimal X app” generally means an app with a simple and straightforward interface, not an app that fits in 64kb.

                                    🇬🇧 The UK geoblock is lifted, hopefully permanently.