extract core logic into the default extension.
support section truncation based on window width. resolves #190.