browse modules by clicking directly on "import" statements on GitHub ⛺

Overview

Module Linker

module linker logo

Module Linker adds direct links in the GitHub source code viewer, to any imported modules or files. If you're browsing source code on GitHub, this extension will improve your life.

python-screencast

Works with all flavours of Javascript, Python, Go, Rust, Nim, Ruby, Elm, Haskell, Julia, Crystal, Purescript and more!

See this page for a full list of supported files, and screenshots.

Install it: https://chrome.google.com/webstore/detail/dglofghjinifeolcpjfjmfdnnbaanggn or https://addons.mozilla.org/firefox/addon/module-linker/

chrome webstore icon firefox icon

Comments
  • Detect files with no extension

    Detect files with no extension

    Here's my initial attempt at #22.

    Feel free to pull in and then add to, extend, or clean up by extracting check functions now that there's two methods. There's two TODOs--c and purescript--I don't really plan to get to those.

    Notes

    • This executes only after no file extensions were matched (extensions still take precedence)
    • I included all supported script languages and left out the declarative ones (Markdown, JSON, dependency files, etc), since they have nothing to run them AFAIK
    • It only checks for #! and common program names to keep it flexible (since not everyone will use #!/usr/bin/env)
    • As a sort of naive conflict resolution, the if statements are sorted by program name length
    • This still defaults to markdown like it did before

    References

    • https://stackoverflow.com/questions/41322300/how-to-execute-rust-code-directly-on-unix-systems-using-the-shebang
    • https://github.com/nim-lang/Nim/issues/3301
    • https://github.com/crystal-lang/crystal/issues/546
    • https://stackoverflow.com/questions/7707178/whats-the-appropriate-go-shebang-line
    • https://stackoverflow.com/questions/25880705/when-writing-a-haskell-script-get-syntax-error-near-unexpected-token
    • https://stackoverflow.com/questions/29718123/cabal-vs-runhaskell-when-to-use
    • https://guide.elm-lang.org/install.html
    opened by joeyespo 12
  • Better support for PHP

    Better support for PHP

    I created better support for PHP. This fixes #46.

    Unfortunately, I wasn't able to link use statements. This could maybe be done with some external API, so if I find (or create) it, I will create another PR.

    Changes in this PR related to PHP:

    • Support for parsing PHP extensions (link ext-* dependency to documentation) in compsoer.json
    • Support for linking name and bin fields in compsoer.json
    • Support for linking PHP's include and require

    Other changes:

    • Allow multiple spaces between key and colon in JSON
    • Merge similar code in JSON parser
    opened by filips123 9
  • Better support for PHP

    Better support for PHP

    Can you add better support for PHP?


    This should include better composer.json handling.

    The current version only links normal dependencies. But it should also link extension dependencies (ext-*) to correct documentation page on PHP documentation website. Suggested dependencies in suggest section should also be linked correctly.

    It should also link name field to package on Packagist (but don't then forget to fix #45), autoload and autoload-dev sections to correct directories and bin section to correct file.

    Composer's composer.json file is similar to Node's package.json so you could take some code from there. You should also look to composer.json schema for reference.


    There should also be parsing of PHP files.

    First, it should link require, require_once, include and include_once to correct files. This is similar to Node, except that it can be used with or without brackets.

    It should also link use statements. This is a bit different because it includes namespace instead of the file. But with autoloading, program then includes correct file. In this case, this extension should somehow "extract" correct file from namespace and link it.

    opened by filips123 7
  • require in crystal stdlib with slash links to top level module

    require in crystal stdlib with slash links to top level module

    In https://github.com/sb89/crystal-swapi/blob/master/src/swapi.cr

    screen shot 2017-03-29 at 12 54 30 pm

    links to https://crystal-lang.org/api/0.21.1/HTTP.html instead of https://crystal-lang.org/api/0.21.1/HTTP/Client.html

    crystal 
    opened by bcardiff 7
  • Add PHP support

    Add PHP support

    Adapting the work from https://github.com/fiatjaf/gh-browser/blob/master/python.js to a PHP should not be hard for anyone familiar with PHP include and require workings.

    php 
    opened by fiatjaf 6
  • Some bugs with `Back` and `Forward` browser buttons

    Some bugs with `Back` and `Forward` browser buttons

    Hello!

    I have some troubles with this extension, when pressing Back and Forward browser buttons :cold_sweat:

    Steps to reproduce:

    1. Load some file, application for example — there are highlights.
    2. Click to some require (require_relative 'router', for example) — works good, now you in router file with highlights.
    3. Press browser Back button — works good, now you in application file again with highlights.
    4. Press browser Forward button — BAM, you in router file without highlights (and some dynamic GitHub loading seen).

    Thanks.

    opened by AlexWayfer 5
  • Linker might run multiple times

    Linker might run multiple times

    It looks like the 'don't run more than once' protection is broken because Github changed their markup?

    This line injects an element to stop the content script from running multiple times but I think it doesn't work because the element it injects into does not exist (or maybe it doesn't always exist).

    In this screenshot, notice that there are multiple dots next to the imports, and the <span id="module-linker-done"> doesn't exist in the page.

    image

    opened by SidneyNemzer 4
  • Random strings containing import can produce weird replacements [python]

    Random strings containing import can produce weird replacements [python]

    See: https://github.com/pypa/setuptools_scm/blob/master/setup.py#L2

    important note
    

    in a docstring turns into

    important note:ant●pan class="pl-s">important note:
    

    (which is undesired)

    Related issue: #38

    python 
    opened by webknjaz 4
  • Scala/SBT support?

    Scala/SBT support?

    I don't know how this works, but I see a variety of different languages, so I guess you have some flexible solution. Would it be possible to add Scala support?

    Actually, if there were some contribution docs, I could try to add it myself..

    opened by laughedelic 4
  • local modules with webpack `resolve`

    local modules with webpack `resolve`

    When local module is written like below, module linker links remote module having same namesake.

    const hello = require('hello');  // it's a local module. not remote.
    

    I suggest that module-linker should find the package.json first. So it can resolve whether the module is local or remote.

    javascript 
    opened by ghost 4
  • Please update haskell files in backend branch OR how to propose update?

    Please update haskell files in backend branch OR how to propose update?

    e.g. https://raw.githubusercontent.com/fiatjaf/module-linker/backends/data/hackage-modules/Data.Align this should return semialign, but returns these

    https://hackage.haskell.org/package/semialign-1.2/docs/Data-Align.html

    opened by srghma 3
  • Extension disappeared from Chrome (

    Extension disappeared from Chrome ("violates the Chrome Web Store policy"?)

    The extension disappeared from Chrome and from its web store: https://chrome.google.com/webstore/detail/dglofghjinifeolcpjfjmfdnnbaanggn

    Any idea why? :)

    EDIT: I see the following. Why does chrome say it violates the policy?

    image

    opened by Boscop 1
  • Lack of SASS partials support

    Lack of SASS partials support

    Hello!

    SASS has partials, which filenames start with _, but it's not written in @import: https://sass-lang.com/documentation/at-rules/import

    So, we're having incorrect links (with 404).

    Example: https://github.com/nana-4/materia-theme/blob/8988c72/src/chrome/chrome-scrollbar-dark/scrollbars.scss

    Incorrect link to https://github.com/nana-4/materia-theme/blob/8988c72/src/_sass/colors.scss

    Correct link is https://github.com/nana-4/materia-theme/blob/8988c72/src/_sass/_colors.scss

    CSS good-first-issue 
    opened by AlexWayfer 0
  • Lots of memory usage (1.6 gb)

    Lots of memory usage (1.6 gb)

    Hey there, great extension!

    I can't really say why but just wanted to point out that there might a memory leak. Been running my mac book for 5 days, 46 mins and the memory has reached 1.6 gb. Cheers

    Screenshot 2019-03-12 at 10 56 27
    opened by zwacky 1
  • Errors at PRs

    Errors at PRs

    Error in event handler for runtime.onMessage: TypeError: Cannot read property '1' of null
        at main (chrome-extension://dglofghjinifeolcpjfjmfdnnbaanggn/dist/full.js:22:64)
        at chrome-extension://dglofghjinifeolcpjfjmfdnnbaanggn/dist/full.js:118:3
    

    Error occurs at this page: https://github.com/getsentry/sentry/pull/7521/files

    Sometimes Back and Forward in browser are broken (I don't know if it cause of this).

    opened by AlexWayfer 0
  • "import" at the beginning of module name in multiline import breaks code representation [python]

    import_plugins turns into import_plugins_plugins●ort_plugins. It might be multiline-only bug, but I haven't checked.

    Example: https://github.com/ansible/ansible/blob/b9b8081/test/runner/lib/cloud/init.py#L19

    source:

    from lib.util import (
        ApplicationError,
        display,
        is_shippable,
        import_plugins,
        load_plugins,
        ABC,
    )
    

    result:

    from lib●.util import (
        ApplicationError,
        display,
        is_shippable,
        import_plugins_plugins●ort_plugins,
        load_plugins,
        ABC,
    )
    
    opened by webknjaz 1
Owner
fiatjaf
vocês não têm nível
fiatjaf
The [cain!] macro is a macro that rewrites sequential Rust branch statements into nested branches

Note! This crate is experimental and under development. It may include bugs that alter the behavior of your code in unexpected ways. You should review

Fredrik Østrem 2 Jan 19, 2022
This crate provides a set of functions to generate SQL statements for various PostgreSQL schema objects

This crate provides a set of functions to generate SQL statements for various PostgreSQL schema objects, such as tables, views, materialized views, functions, triggers, and indexes. The generated SQL statements can be useful for schema introspection, documentation, or migration purposes.

Tyr Chen 11 Apr 4, 2023
lsp server for finding ES statements that throw!

Well, Does it Throw? TLDR; This is a blazingly fast lsp server to find throw statements in your javascript code. It's written in Rust and based on SWC

Michael Angelo Rivera 11 Nov 13, 2023
hackernews_tui is a Terminal UI to browse Hacker News with vim-like key bindings.

hackernews_tui is written in Rust with the help of Cursive TUI library. It uses HN Algolia search APIs to get Hacker News data.

Thang Pham 364 Dec 28, 2022
An implementation of WICG Import Maps specification

import_map A Rust implementation of WICG Import Maps specification. This crates is used in Deno project. The implementation is tested against WPT test

Deno Land 20 Nov 21, 2022
Convert Hygea calendar to an iCal file to easily import it to Google Calendar (Rust version)

Hygea to iCal Goal Hygea provides a calendar via PDF and an application called Recycle. I just wanted to use an iCal file to import it in my calendar.

Guillaume Quittet 2 Oct 28, 2021
import sticker packs from telegram, to be used at the Maunium sticker picker for Matrix

mstickereditor Import sticker packs from telegram, to be used at the Maunium sticker picker for Matrix Requirements: a Stickerpickerserver msrd0/docke

null 11 Dec 27, 2022
Tool for mass import of hosts into Zabbix (and other API functions)

zabbix-tools A CLI tool for interacting with Zabbix API built in Rust. Designed for Zabbix 6.0. Functions added to test API and add hosts manually or

null 1 Apr 21, 2022
Standalone python3.dll import library generator

Standalone python3.dll import library generator Generates import libraries for the Stable ABI Python DLL for MinGW-w64 and MSVC (cross-)compile target

PyO3 7 Oct 9, 2022
Workflows make it easy to browse, search, execute and share commands (or a series of commands)--without needing to leave your terminal.

Workflows The repo for all public Workflows that appear within Warp and within commands.dev. To learn how to create local or repository workflows, see

Warp 369 Jan 2, 2023
Workflows make it easy to browse, search, execute and share commands (or a series of commands)--without needing to leave your terminal.

Workflows The repo for all public Workflows that appear within Warp and within commands.dev. To learn how to create local or repository workflows, see

Warp 227 Jun 1, 2022
Browse and listen to thousands of radio stations across the globe right from your terminal 🌎 📻 🎵✨

TuneIn CLI A command line interface for TuneIn Radio. You can search for stations, play them, and see what's currently playing. ?? Installation Compil

Tsiry Sandratraina 8 Mar 2, 2023
Terminal UI for leetcode. Lets you browse questions through different topics. View, solve, run and submit questions from TUI.

Leetcode TUI Use Leetcode in your terminal. Why this TUI: My motivation for creating leetcode-tui stemmed from my preference for tools that are lightw

Akarsh 8 Aug 10, 2023
A simple Iced application that I wrote as a learning activity, which allows you to browse the full list of regular Material Icons.

Iced Material Icon Browser Iced Material Icon Browser is a simple Iced application that I wrote as a learning activity, which allows you to browse the

BB-301 4 Sep 18, 2023
Radix Babylon vanity address finder allowing easy import into Radix mobile Wallet.

Rad Vanity address finder for Radix Babylon which you can import directly into your Radix Wallet using QR scanner using Import from a Legacy Wallet fe

Alexander Cyon 6 Nov 13, 2023
Cassandra DB native client written in Rust language. Find 1.x versions on https://github.com/AlexPikalov/cdrs/tree/v.1.x Looking for an async version? - Check WIP https://github.com/AlexPikalov/cdrs-async

CDRS CDRS is looking for maintainers CDRS is Apache Cassandra driver written in pure Rust. ?? Looking for an async version? async-std https://github.c

Alex Pikalov 338 Jan 1, 2023
Discover GitHub token scope permission and return you an easy interface for checking token permission before querying GitHub.

github-scopes-rs Discover GitHub token scope permission and return you an easy interface for checking token permission before querying GitHub. In many

null 8 Sep 15, 2022
JSON parser which picks up values directly without performing tokenization in Rust

Pikkr JSON parser which picks up values directly without performing tokenization in Rust Abstract Pikkr is a JSON parser which picks up values directl

Pikkr 615 Dec 29, 2022
VSCode debug extension for probe-rs. It uses the MS DAP protocol to communicate directly with the probe (via probe-rs), and supports basic command line debugging in addition to VSCode UI.

VSCode debug extension for probe-rs. It uses the MS DAP protocol to communicate directly with the probe (via probe-rs), and supports basic command line debugging in addition to VSCode UI.

probe.rs 37 Dec 28, 2022
bevy_blender is a Bevy library that allows you to use assets created in Blender directly from the .blend file

bevy_blender bevy_blender is a Bevy library that allows you to use assets created in Blender directly from the .blend file.

Jerald Thomas 45 Jan 4, 2023