def visit(self, location: Path | URL, remember: bool = True) -> None:
        """Visit the given location.

        Args:
            location: The location to visit.
            remember: Should the visit be added to the history?
        """
        # If the location we've been given looks like it is markdown, be it
        # locally in the filesystem or out on the web...
        if maybe_markdown(location):
            # ...attempt to visit it in the viewer.
            self.query_one(Viewer).visit(location, remember)
        elif isinstance(location, Path):
            # So, it's not Markdown, but it *is* a Path of some sort. If the
            # resource seems to exist...
            if location.exists():
                # ...ask the OS to open it.
                open_url(f"file:///{location.absolute()}")
            else:
                # It's a Path but it doesn't exist, there's not much else we
                # can do with it.
                self.app.push_screen(
                    ErrorDialog(
                        "Does not exist",
                        f"Unable to open {location} because it does not exist.",
                    )
                )
        else:
            # By this point all that's left is it's a URL that, on the
            # surface, doesn't look like a Markdown file. Let's hand off to
            # the operating system anyway.
            open_url(str(location), new=2, autoraise=True)
Visit the given location.

        Args:
            location: The location to visit.
            remember: Should the visit be added to the history?
        
frogmouth/screens/main.py