Sublime Forum

List of bookmarks / entities in a HTML-file

#1

Hello!

I’m new to Sublime so please bear with me :wink:

In Coda / BBEdit I had a way to list the HTML-entities in a HTML-file (using the “Code-Navigator” in Coda or the “Function list” in BBEdit), and when I used a certain notation in the HTML-comments ("!" in Coda respectively “#mark” in BBEdit) I could use those as custom bookmarks for the navigation.

For this file using BBEdit’s “#mark”-notation


<!doctype html>

<head>

	<meta charset="utf-8">
	<meta http-equiv="x-ua-compatible" content="ie=edge">
	<title></title>
	<meta name="description" content="">
	
	<meta name="viewport" content="width=device-width, initial-scale=1">

	<link rel="apple-touch-icon" href="apple-touch-icon.png">
	<!-- Place favicon.ico in the root directory -->
	<link rel="stylesheet" href="css/main.min.css">
	
	<script src="js/vendor/modernizr-2.8.3.min.js"></script>
	
</head>

<body>

	<!--[if lt IE 8]>
		<p class="browserupgrade">
			You are using an <strong>outdated</strong> browser. Please <a
			href="http://browsehappy.com/">upgrade your browser</a> to improve your
			experience.
		</p>
	<![endif]-->

	<!-- Add your site or application content here -->
	<p>Hello world! This is HTML5 Boilerplate.</p>
	<script
		src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js">
	</script>
	<script>
		window.jQuery || 
		document.write('<script src="js/vendor/jquery-1.11.3.min.js"><\/script>')
	</script>
	<script src="js/plugins.min.js"></script>
	<script src="js/main.min.js"></script>
	<script src="js/bootstrap/bootstrap.min.js"></script>
	<!-- Google Analytics: change UA-XXXXX-X to be your site's ID. -->
	<script>
		(function(b,o,i,l,e,r){b.GoogleAnalyticsObject=l;b[l]||(b[l]=
		function(){(b[l].q=b[l].q||]).push(arguments)});b[l].l=+new Date;
		e=o.createElement(i);r=o.getElementsByTagName(i)[0];
		e.src='https://www.google-analytics.com/analytics.js';
		r.parentNode.insertBefore(e,r)}(window,document,'script','ga'));
		ga('create','UA-XXXXX-X','auto');ga('send','pageview');
	</script>
	
</body>

I’ll have this in Coda:

  • css/main.min.css
  • js/vendor/modernizr-2.8.3.min.js
  • js/plugins.min.js
  • js/main.min.js
  • js/bootstrap/bootstrap.min.js

and this in BBEdit:

  • ___________________________________________________________ TITLE
  • _____________________________________________________ DESCRIPTION
  • _____________________________________________________________ CSS
  • __________________________________________________________ JQUERY
  • JAVASCRIPT
  • ______________________________________________________________ JS
  • _________________ ONLY WHILE DEVELOPING: ALL BOOTSTRAP-JS-PLUGINS
  • ________________________________________________ GOOGLE ANALYTICS
  • JAVASCRIPT
  • [anonymous]
  • [l]

Is there something similar in Sublime Text?

Thanks!

Regards,
Vlad

0 Likes

#2

Not by default, but you could write a custom syntax that marks your comment markers as entities and then use goto symbol.

0 Likes

#3

Hello and thanks for the reply!

I have to ask again, sorry for this:

1.- I don’t want all the HTML-comments as bookmarks, only some of them - would this be possible?

2.- How do you write such a custom syntax?

3.- Do I understand you correct: the answer to my main question - is it possible to get a list of this bookmarks / HTML-entities? - is “no!”?

Thanks again!

Regards,
Vlad

0 Likes

#4
  1. If they follow a certain distinguishable structure like those you mentioned in the first post, yes.

  2. sublimetext.com/docs/3/syntax.html outlines a few basics. Unfortunately I do not have the time to walk you through the entire process.

  3. If set up correctly, you will see a list of all found symbols (the comment markers) by opening “goto anything” and then inserting @. Similar to function definitions.

0 Likes

#5

[quote=“FichteFoll”]1. If they follow a certain distinguishable structure like those you mentioned in the first post, yes.

  1. sublimetext.com/docs/3/syntax.html outlines a few basics. Unfortunately I do not have the time to walk you through the entire process.

  2. If set up correctly, you will see a list of all found symbols (the comment markers) by opening “goto anything” and then inserting @. Similar to function definitions.[/quote]

Hey!

1.- Perfect!

2.- That’s more than enough, thank you! I’ll start doing my first syntax file then!

3.- That’s exactly what I want!

Thanks again!

Regards,
Vlad

0 Likes

#6

Oh, and you also need to know about defining symbols, which is outlined here: docs.sublimetext.info/en/latest/ … mbols.html

0 Likes

How to add a global custom symbol marker?
#7

I’ve made the file “BBEdit_marker.tmPreferences” that looks like this:


<?xml version="1.0" encoding="UTF-8"?>




name
Symbol List
BBEdit’s marker as manually defined function for HTML
#mark
settings

showInSymbolList
1
showInIndexedSymbolList
1


in order to define “#mark” as symbol and get them listed (with CMD-R).

Where do I have to save this file in order to let Sublime Text “know” about it?

Regards,
Vlad

0 Likes

#8

Are you using a recent dev build (>=3092)?

0 Likes

#9

Vlad,

Did you ever get this working? I have been searching everywhere on how to accomplish this, but cannot find an example anywhere.

0 Likes

#10

Unfortunately no.

I used Sublime though for the whole project then in order to get a picture :-).

I’ve made immediately after this another similar one (HTML & CSS), this time in BBEdit.

And that is what I’m using since then, for everything text-related.

0 Likes

#11

Vlad,

Too bad. Thanks for the reply though.

0 Likes